mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fix a test case.
This commit is contained in:
parent
0a18c819d4
commit
5bdb57a392
@ -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")
|
||||
|
@ -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"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user