Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ When tags are disabled (`disable_tags` is `True`), this endpoint will return a 4

## Changelog

### 0.2.1
- Add Wagtail 7.2.x support
- Add Wagtail 7.1.x support

### 0.2.0
- Added tags support for terms
- Added tag filtering in term selector
Expand All @@ -365,7 +369,7 @@ When tags are disabled (`disable_tags` is `True`), this endpoint will return a 4
- Add pagination to the terms list
- Improve search to search terms and definitions
- Added `disable_tags` setting to completely disable the tagging functionality
- Add formal wagtail 7.0 support
- Add formal wagtail 7.0.x support

### 0.1.3
- Added setting to change frontend styles
Expand Down
23 changes: 16 additions & 7 deletions wagtailterms/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.core.management import call_command
from django.test import override_settings
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
Expand Down Expand Up @@ -234,9 +235,12 @@ def test_multiple_terms_with_same_tag(self):
self.term2.save()

# Reindex to ensure search index is up to date
get_search_backend().reset_index()
get_search_backend().add_type(Term)

call_command("update_index", verbosity=0)

backend = get_search_backend()
if hasattr(backend, "add_type"): # Wagtail 5
backend.add_type(Term)

response = self.client.get(
f"{reverse('wagtailterms:terms-list')}?tags=test-tag"
)
Expand All @@ -261,10 +265,15 @@ def test_multiple_tag_filter(self):
self.term2.save()

# Reindex to ensure search index is up to date
get_search_backend().reset_index()
get_search_backend().add_type(Term)
get_search_backend().refresh_index()

call_command("update_index", verbosity=0)
backend = get_search_backend()
if hasattr(backend, "add_type"): # Wagtail 5
backend.add_type(Term)
if hasattr(backend, "refresh_indexes"):
backend.refresh_indexes() # Wagtail 7.2+
elif hasattr(backend, "refresh_index"):
backend.refresh_index() # Wagtail 5.x – 7.1

response = self.client.get(
f"{reverse('wagtailterms:terms-list')}?tags=tag1&tags=tag2"
)
Expand Down