Files
mayan-edms/mayan/apps/document_indexing/tests/mixins.py
Roberto Rosario 0267c79b07 Backport test improvements
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-20 02:39:57 -04:00

19 lines
501 B
Python

from __future__ import unicode_literals
from ..models import Index
from .literals import TEST_INDEX_LABEL
class DocumentIndexingTestMixin(object):
def _create_test_index(self, rebuild=False):
# Create empty index
self.test_index = Index.objects.create(label=TEST_INDEX_LABEL)
# Add our document type to the new index
self.test_index.document_types.add(self.test_document_type)
# Rebuild indexes
if rebuild:
Index.objects.rebuild()