-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix index entries in usage reports (#5)
* squash commits. fix version to 5, add signals / hooks * make index entries visible to usage reports * update tests * improve error handling * stop unpublished and draft pages from being indexed
- Loading branch information
1 parent
ca46eef
commit 1850b7c
Showing
7 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,8 @@ wagtail_streamfield_index.egg-info | |
media/ | ||
Pipfile | ||
Pipfile.lock | ||
venv/ | ||
.venv/ | ||
build/ | ||
__pycache__ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,15 @@ | |
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
INSTALL_REQUIRES = ["django>=3.2", "Wagtail>=4.0"] | ||
INSTALL_REQUIRES = ["django>=3.2", "Wagtail>=5.0.0", " wagtail < 6.0"] | ||
|
||
TESTING_REQUIRES = ["pytest==5.2.1", "pytest-django==3.5.1", "pytest-pythonpath==0.7.3"] | ||
TESTING_REQUIRES = ["pytest==6.2.5", "pytest-django==3.5.1", "pytest-pythonpath==0.7.3", "factory-boy>=3.2"] | ||
|
||
LINTING_REQUIRES = ["black==20.8b1", "flake8==3.7.8", "flake8-black==0.1.1", "isort==5.7.0"] | ||
|
||
setup( | ||
name="wagtail-streamfield-index", | ||
version="0.0.4", | ||
version="1.0.0", | ||
description="Indexing for Wagtail streamfields", | ||
author="Mike Monteith", | ||
author_email="<[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
from django.urls import reverse | ||
from wagtail.test.utils.wagtail_factories import PageFactory | ||
from wagtail.tests.utils import WagtailTestUtils | ||
|
||
import streamfieldindex | ||
from streamfieldindex.wagtail_hooks import IndexEntryAdminURLFinder | ||
|
||
|
||
@pytest.mark.django_db | ||
class TestIndexEntryAdminURLFinder(WagtailTestUtils): | ||
def test_construct_edit_url(self): | ||
finder = IndexEntryAdminURLFinder() | ||
instance = streamfieldindex.models.IndexEntry( | ||
page=PageFactory(), | ||
block_type="text", | ||
block_value="Hello, world!", | ||
block_path="content", | ||
) | ||
expected_url = reverse("wagtailadmin_pages:edit", args=[instance.page.id]) | ||
assert finder.construct_edit_url(instance) == expected_url |