Consolidate some document indexing test code into a new mixin.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
14
mayan/apps/document_indexing/tests/mixins.py
Normal file
14
mayan/apps/document_indexing/tests/mixins.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..models import Index
|
||||
|
||||
from .literals import TEST_INDEX_LABEL
|
||||
|
||||
|
||||
class DocumentIndexingTestMixin(object):
|
||||
def _create_index(self):
|
||||
# Create empty index
|
||||
self.index = Index.objects.create(label=TEST_INDEX_LABEL)
|
||||
|
||||
# Add our document type to the new index
|
||||
self.index.document_types.add(self.document_type)
|
||||
Reference in New Issue
Block a user