Skip to content

Commit

Permalink
Refactored unittest to check duplicated schedule validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-palii committed Aug 9, 2024
1 parent 572455e commit 46b548f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions temba/triggers/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ def test_create_schedule(self):
self.assertEqual({group2}, set(trigger.exclude_groups.all()))
self.assertEqual({contact1}, set(trigger.contacts.all()))

# there is no conflict detection for scheduled triggers so can create the same trigger again
# there is conflict detection for scheduled triggers so can not create the same trigger again
self.assertCreateSubmit(
create_url,
{
Expand All @@ -762,8 +762,7 @@ def test_create_schedule(self):
"contacts": omnibox_serialize(self.org, [], [contact1], json_encode=True),
"exclude_groups": [group2.id],
},
new_obj_query=Trigger.objects.filter(trigger_type="S", flow=flow1).exclude(id=trigger.id),
success_status=200,
form_errors={"__all__": "There already exists a trigger of this type with these options."},
)

def test_create_inbound_call(self):
Expand Down

0 comments on commit 46b548f

Please sign in to comment.