diff --git a/src/documents/tests/test_api.py b/src/documents/tests/test_api.py index adfce313f..70b8bb9eb 100644 --- a/src/documents/tests/test_api.py +++ b/src/documents/tests/test_api.py @@ -41,15 +41,8 @@ class TestDocumentApi(DirectoriesMixin, APITestCase): returned_doc = response.data['results'][0] self.assertEqual(returned_doc['id'], doc.id) self.assertEqual(returned_doc['title'], doc.title) - self.assertEqual(returned_doc['correspondent_object']['name'], c.name) - self.assertEqual(returned_doc['document_type_object']['name'], dt.name) - self.assertEqual(returned_doc['correspondent_object']['id'], c.id) - self.assertEqual(returned_doc['document_type_object']['id'], dt.id) - self.assertEqual(returned_doc['correspondent_object']['id'], returned_doc['correspondent']) - self.assertEqual(returned_doc['document_type_object']['id'], returned_doc['document_type']) - self.assertEqual(len(returned_doc['tags']), 1) - self.assertEqual(returned_doc['tags_objects'][0]['name'], tag.name) - self.assertEqual(returned_doc['tags_objects'][0]['id'], tag.id) + self.assertEqual(returned_doc['correspondent'], c.id) + self.assertEqual(returned_doc['document_type'], dt.id) self.assertListEqual(returned_doc['tags'], [tag.id]) c2 = Correspondent.objects.create(name="c2") diff --git a/src/documents/tests/test_post_consume_handlers.py b/src/documents/tests/test_post_consume_handlers.py index fb4c9fc12..b4357448c 100644 --- a/src/documents/tests/test_post_consume_handlers.py +++ b/src/documents/tests/test_post_consume_handlers.py @@ -53,5 +53,4 @@ class PostConsumeTestCase(TestCase): self.assertEqual(command[5], f"/api/documents/{doc.pk}/download/") self.assertEqual(command[6], f"/api/documents/{doc.pk}/thumb/") self.assertEqual(command[7], "my_bank") - # TODO: tags are unordered by default. - self.assertEqual(command[8], "a,b") + self.assertCountEqual(command[8].split(","), ["a", "b"])