Ejemplo n.º 1
0
 def test_created_document_is_indexed(self, index_mock):
     form = DemoMetadataForm({
         'title': 'Title',
     }, category=self.category)
     rev_form = DemoMetadataRevisionForm(
         {
             'docclass': '1',
             'received_date': '2015-01-01',
             'created_on': '2015-01-01',
         },
         category=self.category)
     save_document_forms(form, rev_form, self.category)
     self.assertEqual(index_mock.call_count, 1)
Ejemplo n.º 2
0
 def test_revised_document_is_indexed(self, index_mock):
     form = DemoMetadataForm({
         'title': 'Title',
     }, category=self.category)
     rev_form = DemoMetadataRevisionForm(
         {
             'docclass': '1',
             'received_date': '2015-01-01',
             'created_on': '2015-01-01',
         },
         category=self.category)
     doc, meta, rev = save_document_forms(form, rev_form, self.category)
     revision = doc.latest_revision
     revision.pk = None
     revision.save()
     doc.save()
     self.assertEqual(index_mock.call_count, 2)