|
1 | | -from unittest.mock import Mock |
2 | | -import uuid |
3 | | - |
4 | 1 | import pytest |
| 2 | +import uuid |
5 | 3 | from rest_framework import status |
6 | 4 | from shipchain_common.test_utils import AssertionHelper |
| 5 | +from unittest.mock import Mock |
7 | 6 |
|
8 | 7 | EXAMPLE_PLAIN = { |
9 | 8 | 'id': '07b374c3-ed9b-4811-901a-d0c5d746f16a', |
@@ -738,10 +737,21 @@ def test_entity_list_non_list_response(self, vnd_single): |
738 | 737 |
|
739 | 738 | def test_vnd_entity_uuid_pk(self, vnd_single): |
740 | 739 | response = self.build_response(vnd_single) |
741 | | - AssertionHelper.HTTP_200(response, entity_refs=AssertionHelper.EntityRef( |
742 | | - resource=EXAMPLE_RESOURCE['type'], |
743 | | - pk=uuid.UUID(EXAMPLE_RESOURCE['id']) |
744 | | - )) |
| 740 | + AssertionHelper.HTTP_200( |
| 741 | + response, |
| 742 | + entity_refs=AssertionHelper.EntityRef( |
| 743 | + resource=EXAMPLE_RESOURCE['type'], |
| 744 | + pk=uuid.UUID(EXAMPLE_RESOURCE['id']), |
| 745 | + attributes=EXAMPLE_RESOURCE['attributes'], |
| 746 | + relationships={'owner': AssertionHelper.EntityRef( |
| 747 | + resource=EXAMPLE_USER['type'], |
| 748 | + pk=uuid.UUID(EXAMPLE_USER['id']), |
| 749 | + )} |
| 750 | + ), |
| 751 | + included=AssertionHelper.EntityRef( |
| 752 | + resource=EXAMPLE_RESOURCE_2['type'], |
| 753 | + pk=uuid.UUID(EXAMPLE_RESOURCE_2['id']), |
| 754 | + )) |
745 | 755 |
|
746 | 756 | def test_vnd_entity_full_match(self, vnd_single): |
747 | 757 | response = self.build_response(vnd_single) |
|
0 commit comments