summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2021-12-01 17:11:33 +0000
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-08 09:58:49 +0200
commited7de8c501a2bd8dcab703c38e2667a3a9b13b62 (patch)
tree65c88820650ac0285c567226e05a427036ccc767 /ishtar_common/tests.py
parentdedcccd75354b011adb7f4a9073f0a61ea1d652a (diff)
downloadIshtar-ed7de8c501a2bd8dcab703c38e2667a3a9b13b62.tar.bz2
Ishtar-ed7de8c501a2bd8dcab703c38e2667a3a9b13b62.zip
rapid action on document add document with parent source with tests #5172 part four: test perfectionning
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 418b8a24b..b14cc5ab3 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -3591,28 +3591,27 @@ class DocumentTest(TestCase):
c.login(username=self.username, password=self.password)
response = c.get(url)
self.assertEqual(response.status_code, 200)
- content = response.content.decode()
self.assertIn(
'option value="{}" selected'.format(self.ope1.pk),
- content
+ response.content.decode()
)
- self.assertIn(doc.title, content)
+ self.assertIn(doc.title, response.content.decode())
posted = {"authors": [], "title": "A child document"}
posted["operations"] = [str(self.ope1.pk)]
posted["source"] = [doc.pk]
response = c.post(url, posted)
- new_child_document_pk = self.ope1.documents.order_by("-pk").all()[0].pk
+ new_child_document = self.ope1.documents.order_by("-pk").all()[0]
self.assertEqual(nb_doc + 1, models.Document.objects.count())
self.assertRedirects(
response,
"/document/edit/?open_item={}".format(
- new_child_document_pk
+ new_child_document.pk
),
)
response = c.get("/show-document/{}/".format(doc.pk))
- self.assertIn(posted["title"], content)
- self.assertIn(doc.title, content)
+ self.assertIn(new_child_document.title, response.content.decode())
+ self.assertIn(doc.title, response.content.decode())
class JinjaFilterTest(TestCase):