|
4 | 4 |
|
5 | 5 | from datetime import datetime
|
6 | 6 | from test.conftest import add_ids_to_properties
|
7 |
| -from test.e2e.conftest import replace_unit_values_with_ids_in_properties |
| 7 | +from test.e2e.conftest import E2ETestHelpers, replace_unit_values_with_ids_in_properties |
8 | 8 | from test.e2e.mock_schemas import USAGE_STATUS_POST_B
|
9 | 9 | from test.e2e.test_catalogue_item import CATALOGUE_CATEGORY_POST_A, CATALOGUE_ITEM_POST_A
|
10 | 10 | from test.e2e.test_item import ITEM_POST, MANUFACTURER_POST
|
@@ -374,16 +374,7 @@ def check_patch_system_response_success(self, expected_system_get_data: dict):
|
374 | 374 | assert self._patch_response.status_code == 200
|
375 | 375 | assert self._patch_response.json() == expected_system_get_data
|
376 | 376 |
|
377 |
| - # pylint:disable=fixme |
378 |
| - # TODO: Move the below code into a utility or something later - will be wanted for other tests? |
379 |
| - original_data = self._post_response.json() |
380 |
| - new_data = self._patch_response.json() |
381 |
| - |
382 |
| - # Created time should be unchanged, but new modified time should be greater than before |
383 |
| - assert original_data["created_time"] == new_data["created_time"] |
384 |
| - assert datetime.fromisoformat(new_data["modified_time"]) > datetime.fromisoformat( |
385 |
| - original_data["modified_time"] |
386 |
| - ) |
| 377 | + E2ETestHelpers.check_created_and_modified_times_updated_correctly(self._post_response, self._patch_response) |
387 | 378 |
|
388 | 379 | def check_patch_system_failed_with_message(self, status_code: int, detail: str):
|
389 | 380 | """Checks that a prior call to 'patch_system' gave a failed response with the expected code and error message"""
|
|
0 commit comments