fix a test case.

This commit is contained in:
jonaswinkler 2020-12-04 01:18:06 +01:00
parent 0a18c819d4
commit 5bdb57a392
2 changed files with 3 additions and 11 deletions

View File

@ -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")

View File

@ -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"])