diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/tests.py | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index f4e372770..d15675769 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -3918,10 +3918,16 @@ class DocumentTest(TestCase):          c.login(username=self.username, password=self.password)          response = c.get(url)          self.assertEqual(response.status_code, 200) -        self.assertIn( -            'option value="{}" selected'.format(self.ope1.pk), -            response.content.decode() -        ) + +        result = response.content.decode() +        soup = Soup(result, "lxml") +        ok = False +        for field in soup.findAll("option"): +            keys = list(field.attrs.keys()) +            if "selected" in keys and "value" in keys and field["value"] == str(self.ope1.pk): +                ok = True +                break +        self.assertTrue(ok, msg="Operation not selected in Document form")          self.assertIn(doc.title, response.content.decode())          posted = {"authors": [], "title": "A child document"} | 
