Exemplo n.º 1
0
 def test_includes_only_right_mistakes(self):
     contexts = Act.generate_act_contexts({})
     org2 = [x for x in contexts if x['organization'] == self.org2][0]
     self.assertIn(self.mistake2.full_text, org2['mistakes_text'])
     self.assertNotIn(self.mistake1.full_text, org2['mistakes_text'])
     org3 = [x for x in contexts if x['organization'] == self.org3][0]
     self.assertIn(self.mistake2.full_text, org3['mistakes_text'])
     self.assertIn(self.mistake1.full_text, org3['mistakes_text'])
Exemplo n.º 2
0
 def test_includes_only_contribs_with_mistakes(self):
     contexts = Act.generate_act_contexts({})
     self.assertEqual(len([x for x in contexts if x['organization'] == self.org2]), 1)
     self.assertEqual(len([x for x in contexts if x['organization'] == self.org4]), 0)
Exemplo n.º 3
0
 def test_includes_only_notifies_with_mistakes(self):
     contexts = Act.generate_act_contexts({})
     org2 = [x for x in contexts if x['organization'] == self.org2][0]
     self.assertIn(self.notify2, org2['notifies'])
     self.assertIn(self.notify222, org2['notifies'])
     self.assertNotIn(self.notify22, org2['notifies'])
Exemplo n.º 4
0
 def test_contains_required_keys(self):
     contexts = Act.generate_act_contexts({})
     for key in ['date', 'organization', 'reporting_quarter_date', 'year', 'notifies', 'paragraph', 'mistakes_text']:
         self.assertIn(key ,contexts[0])