示例#1
0
 def test_updated_document_is_indexed(self, index_mock):
     doc = DocumentFactory(
         category=self.category,
         document_key='FAC09001-FWF-000-HSE-REP-0004',
     )
     doc.title = 'foobar'
     doc.save()
     self.assertEqual(index_mock.call_count, 2)
示例#2
0
 def test_revised_document_is_indexed(self, index_mock):
     doc = DocumentFactory(
         category=self.category,
         document_key='FAC09001-FWF-000-HSE-REP-0004',
     )
     revision = doc.latest_revision
     revision.pk = None
     revision.save()
     doc.save()
     self.assertEqual(index_mock.call_count, 2)