Skip to content

Commit

Permalink
Merge pull request #893 from MaibornWolff/chore/python_3.12
Browse files Browse the repository at this point in the history
chore(deps): upgrade to python 3.12
  • Loading branch information
StefanFl authored Dec 24, 2023
2 parents 6e8d1a0 + 8430354 commit 8a7bf85
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 42 deletions.
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
]

[tool.poetry.dependencies]
python = ">= 3.10, < 3.12"
python = ">= 3.10, < 3.13"
# Django
# ------------------------------------------------------------------------------
django = "4.2.8" # https://www.djangoproject.com/
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class TestAuthorizationBranches(TestAuthorizationBase):
def test_authorization_branches(self):
expected_data = "OrderedDict([('count', 3), ('next', None), ('previous', None), ('results', [OrderedDict([('id', 1), ('name_with_product', 'db_branch_internal_dev (db_product_internal)'), ('is_default_branch', True), ('open_critical_observation_count', 0), ('open_high_observation_count', 0), ('open_medium_observation_count', 0), ('open_low_observation_count', 0), ('open_none_observation_count', 0), ('open_unkown_observation_count', 0), ('name', 'db_branch_internal_dev'), ('last_import', None), ('housekeeping_protect', False), ('product', 1)]), OrderedDict([('id', 2), ('name_with_product', 'db_branch_internal_main (db_product_internal)'), ('is_default_branch', False), ('open_critical_observation_count', 0), ('open_high_observation_count', 0), ('open_medium_observation_count', 0), ('open_low_observation_count', 0), ('open_none_observation_count', 0), ('open_unkown_observation_count', 0), ('name', 'db_branch_internal_main'), ('last_import', None), ('housekeeping_protect', False), ('product', 1)]), OrderedDict([('id', 3), ('name_with_product', 'db_branch_external (db_product_external)'), ('is_default_branch', True), ('open_critical_observation_count', 0), ('open_high_observation_count', 0), ('open_medium_observation_count', 0), ('open_low_observation_count', 0), ('open_none_observation_count', 0), ('open_unkown_observation_count', 0), ('name', 'db_branch_external'), ('last_import', None), ('housekeeping_protect', False), ('product', 2)])])])"
expected_data = "OrderedDict({'count': 3, 'next': None, 'previous': None, 'results': [OrderedDict({'id': 1, 'name_with_product': 'db_branch_internal_dev (db_product_internal)', 'is_default_branch': True, 'open_critical_observation_count': 0, 'open_high_observation_count': 0, 'open_medium_observation_count': 0, 'open_low_observation_count': 0, 'open_none_observation_count': 0, 'open_unkown_observation_count': 0, 'name': 'db_branch_internal_dev', 'last_import': None, 'housekeeping_protect': False, 'product': 1}), OrderedDict({'id': 2, 'name_with_product': 'db_branch_internal_main (db_product_internal)', 'is_default_branch': False, 'open_critical_observation_count': 0, 'open_high_observation_count': 0, 'open_medium_observation_count': 0, 'open_low_observation_count': 0, 'open_none_observation_count': 0, 'open_unkown_observation_count': 0, 'name': 'db_branch_internal_main', 'last_import': None, 'housekeeping_protect': False, 'product': 1}), OrderedDict({'id': 3, 'name_with_product': 'db_branch_external (db_product_external)', 'is_default_branch': True, 'open_critical_observation_count': 0, 'open_high_observation_count': 0, 'open_medium_observation_count': 0, 'open_low_observation_count': 0, 'open_none_observation_count': 0, 'open_unkown_observation_count': 0, 'name': 'db_branch_external', 'last_import': None, 'housekeeping_protect': False, 'product': 2})]})"
self._test_api(
APITest("db_admin", "get", "/api/branches/", None, 200, expected_data)
)

expected_data = "OrderedDict([('count', 2), ('next', None), ('previous', None), ('results', [OrderedDict([('id', 1), ('name_with_product', 'db_branch_internal_dev (db_product_internal)'), ('is_default_branch', True), ('open_critical_observation_count', 0), ('open_high_observation_count', 0), ('open_medium_observation_count', 0), ('open_low_observation_count', 0), ('open_none_observation_count', 0), ('open_unkown_observation_count', 0), ('name', 'db_branch_internal_dev'), ('last_import', None), ('housekeeping_protect', False), ('product', 1)]), OrderedDict([('id', 2), ('name_with_product', 'db_branch_internal_main (db_product_internal)'), ('is_default_branch', False), ('open_critical_observation_count', 0), ('open_high_observation_count', 0), ('open_medium_observation_count', 0), ('open_low_observation_count', 0), ('open_none_observation_count', 0), ('open_unkown_observation_count', 0), ('name', 'db_branch_internal_main'), ('last_import', None), ('housekeeping_protect', False), ('product', 1)])])])"
expected_data = "OrderedDict({'count': 2, 'next': None, 'previous': None, 'results': [OrderedDict({'id': 1, 'name_with_product': 'db_branch_internal_dev (db_product_internal)', 'is_default_branch': True, 'open_critical_observation_count': 0, 'open_high_observation_count': 0, 'open_medium_observation_count': 0, 'open_low_observation_count': 0, 'open_none_observation_count': 0, 'open_unkown_observation_count': 0, 'name': 'db_branch_internal_dev', 'last_import': None, 'housekeeping_protect': False, 'product': 1}), OrderedDict({'id': 2, 'name_with_product': 'db_branch_internal_main (db_product_internal)', 'is_default_branch': False, 'open_critical_observation_count': 0, 'open_high_observation_count': 0, 'open_medium_observation_count': 0, 'open_low_observation_count': 0, 'open_none_observation_count': 0, 'open_unkown_observation_count': 0, 'name': 'db_branch_internal_main', 'last_import': None, 'housekeeping_protect': False, 'product': 1})]})"
self._test_api(
APITest(
"db_internal_write",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestAuthorizationGeneralRules(TestAuthorizationBase):
def test_authorization_general_rules(self):
# --- general_rules ---

expected_data = "OrderedDict([('count', 1), ('next', None), ('previous', None), ('results', [OrderedDict([('id', 3), ('name', 'db_general_rule'), ('description', ''), ('scanner_prefix', ''), ('title', ''), ('description_observation', ''), ('origin_component_name_version', ''), ('origin_docker_image_name_tag', ''), ('origin_endpoint_url', ''), ('origin_service_name', ''), ('origin_source_file', ''), ('new_severity', ''), ('new_status', ''), ('enabled', True), ('parser', 1)])])])"
expected_data = "OrderedDict({'count': 1, 'next': None, 'previous': None, 'results': [OrderedDict({'id': 3, 'name': 'db_general_rule', 'description': '', 'scanner_prefix': '', 'title': '', 'description_observation': '', 'origin_component_name_version': '', 'origin_docker_image_name_tag': '', 'origin_endpoint_url': '', 'origin_service_name': '', 'origin_source_file': '', 'new_severity': '', 'new_status': '', 'enabled': True, 'parser': 1})]})"
self._test_api(
APITest(
"db_internal_write",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class TestAuthorizationNotifications(TestAuthorizationBase):
def test_authorization_notifications(self):
expected_data = "OrderedDict([('count', 6), ('next', None), ('previous', None), ('results', [OrderedDict([('id', 1), ('message', 'message_exception_internal'), ('product_name', 'db_product_internal'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_internal_write'), ('name', 'exception_internal'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Exception'), ('function', ''), ('arguments', ''), ('user', 2), ('product', 1), ('observation', 1)]), OrderedDict([('id', 2), ('message', 'message_exception_external'), ('product_name', 'db_product_external'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_external'), ('name', 'exception_external'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Exception'), ('function', ''), ('arguments', ''), ('user', 4), ('product', 2), ('observation', 2)]), OrderedDict([('id', 3), ('message', ''), ('product_name', 'db_product_internal'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_internal_write'), ('name', 'security_gate_internal'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Security gate'), ('function', ''), ('arguments', ''), ('user', 2), ('product', 1), ('observation', 1)]), OrderedDict([('id', 4), ('message', ''), ('product_name', 'db_product_external'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_external'), ('name', 'security_gate_internal'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Security gate'), ('function', ''), ('arguments', ''), ('user', 4), ('product', 2), ('observation', 2)]), OrderedDict([('id', 5), ('message', 'message_task_internal'), ('product_name', 'db_product_internal'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_internal_write'), ('name', 'task_internal'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Task'), ('function', 'function_task_internal'), ('arguments', 'arguments_task_internal'), ('user', 2), ('product', 1), ('observation', 1)]), OrderedDict([('id', 6), ('message', 'message_task_external'), ('product_name', 'db_product_external'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_external'), ('name', 'task_external'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Task'), ('function', 'function_task_external'), ('arguments', 'arguments_task_external'), ('user', 4), ('product', 2), ('observation', 2)])])])"
expected_data = "OrderedDict({'count': 6, 'next': None, 'previous': None, 'results': [OrderedDict({'id': 1, 'message': 'message_exception_internal', 'product_name': 'db_product_internal', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_internal_write', 'name': 'exception_internal', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Exception', 'function': '', 'arguments': '', 'user': 2, 'product': 1, 'observation': 1}), OrderedDict({'id': 2, 'message': 'message_exception_external', 'product_name': 'db_product_external', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_external', 'name': 'exception_external', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Exception', 'function': '', 'arguments': '', 'user': 4, 'product': 2, 'observation': 2}), OrderedDict({'id': 3, 'message': '', 'product_name': 'db_product_internal', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_internal_write', 'name': 'security_gate_internal', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Security gate', 'function': '', 'arguments': '', 'user': 2, 'product': 1, 'observation': 1}), OrderedDict({'id': 4, 'message': '', 'product_name': 'db_product_external', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_external', 'name': 'security_gate_internal', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Security gate', 'function': '', 'arguments': '', 'user': 4, 'product': 2, 'observation': 2}), OrderedDict({'id': 5, 'message': 'message_task_internal', 'product_name': 'db_product_internal', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_internal_write', 'name': 'task_internal', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Task', 'function': 'function_task_internal', 'arguments': 'arguments_task_internal', 'user': 2, 'product': 1, 'observation': 1}), OrderedDict({'id': 6, 'message': 'message_task_external', 'product_name': 'db_product_external', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_external', 'name': 'task_external', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Task', 'function': 'function_task_external', 'arguments': 'arguments_task_external', 'user': 4, 'product': 2, 'observation': 2})]})"
self._test_api(
APITest("db_admin", "get", "/api/notifications/", None, 200, expected_data)
)

expected_data = "OrderedDict([('count', 2), ('next', None), ('previous', None), ('results', [OrderedDict([('id', 3), ('message', ''), ('product_name', 'db_product_internal'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_internal_write'), ('name', 'security_gate_internal'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Security gate'), ('function', ''), ('arguments', ''), ('user', 2), ('product', 1), ('observation', 1)]), OrderedDict([('id', 5), ('message', '...'), ('product_name', 'db_product_internal'), ('observation_title', 'db_observation_internal'), ('user_full_name', 'db_internal_write'), ('name', 'task_internal'), ('created', '2022-12-15T17:10:35.518000+01:00'), ('type', 'Task'), ('function', 'function_task_internal'), ('arguments', 'arguments_task_internal'), ('user', 2), ('product', 1), ('observation', 1)])])])"
expected_data = "OrderedDict({'count': 2, 'next': None, 'previous': None, 'results': [OrderedDict({'id': 3, 'message': '', 'product_name': 'db_product_internal', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_internal_write', 'name': 'security_gate_internal', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Security gate', 'function': '', 'arguments': '', 'user': 2, 'product': 1, 'observation': 1}), OrderedDict({'id': 5, 'message': '...', 'product_name': 'db_product_internal', 'observation_title': 'db_observation_internal', 'user_full_name': 'db_internal_write', 'name': 'task_internal', 'created': '2022-12-15T17:10:35.518000+01:00', 'type': 'Task', 'function': 'function_task_internal', 'arguments': 'arguments_task_internal', 'user': 2, 'product': 1, 'observation': 1})]})"
self._test_api(
APITest(
"db_internal_write",
Expand Down Expand Up @@ -60,7 +60,9 @@ def test_authorization_notifications(self):
)
)

expected_data = "OrderedDict([('count', 0), ('next', None), ('previous', None), ('results', [])])"
expected_data = (
"OrderedDict({'count': 0, 'next': None, 'previous': None, 'results': []})"
)
self._test_api(
APITest(
"db_internal_write",
Expand Down
Loading

0 comments on commit 8a7bf85

Please sign in to comment.