def test_respond_to_issues_checks_issues_and_model_issues(self, respond): # Setup the scenario i = Issue.objects.create(name='an-issue') am1 = G(Assertion, name='1') mi = ModelIssue.objects.create(record_id=am1.id, record_type=ContentType.objects.get_for_model(Issue)) G(Responder) # Run the code respond_to_issues() # Verify expectations respond.assert_has_calls([call(i), call(mi)], any_order=True)
def test_respond_to_issues_checks_issues_and_model_issues(self, respond): # Setup the scenario i = Issue.objects.create(name='an-issue') am1 = G(Assertion, name='1') mi = ModelIssue.objects.create( record_id=am1.id, record_type=ContentType.objects.get_for_model(Issue)) G(Responder) # Run the code respond_to_issues() # Verify expectations respond.assert_has_calls([call(i), call(mi)], any_order=True)
def handle(self, *args, **options): respond_to_issues()