def test_intervention_filter_for_tribunes(self): author = ProfileFactory() opinion = PublishedContentFactory(type="OPINION", author_list=[author.user]) alerter = ProfileFactory() staff = StaffProfileFactory() alert = Alert() alert.scope = "CONTENT" alert.author = alerter.user alert.content = opinion alert.pubdate = datetime.datetime.now() alert.text = "Something to say." alert.save() filter_result = get_header_notifications(staff.user)["alerts"] self.assertEqual(1, filter_result["total"]) self.assertEqual(alert.text, filter_result["list"][0]["text"])
def test_intervention_filter_for_tribunes(self): author = ProfileFactory() opinion = PublishedContentFactory(type='OPINION', author_list=[author.user]) alerter = ProfileFactory() staff = StaffProfileFactory() alert = Alert() alert.scope = 'CONTENT' alert.author = alerter.user alert.content = opinion alert.pubdate = datetime.datetime.now() alert.text = 'Something to say.' alert.save() filter_result = get_header_notifications(staff.user)['alerts'] self.assertEqual(1, filter_result['total']) self.assertEqual(alert.text, filter_result['list'][0]['text'])