X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=tests%2Fconditions.py;h=25a044fe88d87019334a70a9befd18c8e60818da;hb=f02e0fc13b49dc5b38924ba3ad8c485007a72cb2;hp=8f86854f16f0c47aa676b7b9b3ce07b49660c107;hpb=1a9557367351fe26d08ea705400b3b56394caae6;p=plomtask diff --git a/tests/conditions.py b/tests/conditions.py index 8f86854..25a044f 100644 --- a/tests/conditions.py +++ b/tests/conditions.py @@ -51,6 +51,7 @@ class TestsWithServer(TestCaseWithServer): self.check_post(post, '/condition', 302, '/condition?id=1') # … single /condition cond = self.cond_as_dict(titles=['foo'], descriptions=['oof']) + assert isinstance(cond['_versioned'], dict) expected_single: dict[str, object] expected_single = {'is_new': False, 'enabled_processes': [], @@ -72,7 +73,6 @@ class TestsWithServer(TestCaseWithServer): # test effect of POST changing title and activeness post = {'title': 'bar', 'description': 'oof', 'is_active': True} self.check_post(post, '/condition?id=1', 302) - assert isinstance(cond['_versioned'], dict) cond['_versioned']['title'][1] = 'bar' cond['is_active'] = True self.check_json_get('/condition?id=1', expected_single) @@ -102,8 +102,12 @@ class TestsWithServer(TestCaseWithServer): 'enables': [1], 'blockers': [1]} self.post_process(2, proc_2_post) cond = self.cond_as_dict(titles=['foo'], descriptions=['oof']) - proc_1 = self.proc_as_dict(conditions=[cond], disables=[cond]) - proc_2 = self.proc_as_dict(2, 'B', blockers=[cond], enables=[cond]) + assert isinstance(cond['id'], int) + proc_1 = self.proc_as_dict(conditions=[cond['id']], + disables=[cond['id']]) + proc_2 = self.proc_as_dict(2, 'B', + blockers=[cond['id']], + enables=[cond['id']]) expected = {'is_new': False, 'enabled_processes': self.as_id_list([proc_1]), 'disabled_processes': self.as_id_list([proc_2]),