Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jan 19, 2022
1 parent b0b2b29 commit f3de37f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions core/collections/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,17 @@ def apply_parameters(self, queryset):

def index_concepts(self):
if self.concepts.exists():
index_expansion_concepts.apply_async((self.id, ), queue='indexing')
if get(settings, 'TEST_MODE', False):
index_expansion_concepts(self.id)
else:
index_expansion_concepts.apply_async((self.id, ), queue='indexing')

def index_mappings(self):
if self.mappings.exists():
index_expansion_mappings.apply_async((self.id, ), queue='indexing')
if get(settings, 'TEST_MODE', False):
index_expansion_mappings(self.id)
else:
index_expansion_mappings.apply_async((self.id, ), queue='indexing')

def index_all(self):
self.index_concepts()
Expand All @@ -609,8 +615,9 @@ def delete_expressions(self, expressions):
self.concepts.set(self.concepts.exclude(uri__in=expressions))
self.mappings.set(self.mappings.exclude(uri__in=expressions))

batch_index_resources.apply_async(('concept', dict(uri__in=expressions)), queue='indexing')
batch_index_resources.apply_async(('mapping', dict(uri__in=expressions)), queue='indexing')
if not get(settings, 'TEST_MODE', False):
batch_index_resources.apply_async(('concept', dict(uri__in=expressions)), queue='indexing')
batch_index_resources.apply_async(('mapping', dict(uri__in=expressions)), queue='indexing')

def add_references(self, references, index=True):
if isinstance(references, CollectionReference):
Expand Down

0 comments on commit f3de37f

Please sign in to comment.