coderedcorp/wagtail-cache

unit tests are all broken

marcus-steinbach opened this issue · 0 comments

(unrelated - unit tests are all broken in main branch due to some pip package change... need to hunt that down).

  1. setting.py remove wagtail.core.middleware.SiteMiddleware

    https://docs.wagtail.io/en/v2.8.1/getting_started/integrating_into_django.html
    Wagtail is currently incompatible with projects using django.contrib.sites.middleware.CurrentSiteMiddleware, as both this and wagtail.core.middleware.SiteMiddleware set the attribute request.site.

  2. tests.py(61) change to cls.page_wagtailpage = WagtailPage.objects.get(slug="home").get_parent().specific

Now I receive the following issue.

FAILED testproject/home/tests.py::WagtailCacheTest::test_page_hit - AssertionError: 'hit' != 'miss'
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_hit_without_auth - AssertionError: 'hit' != 'miss'
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_miss - AssertionError: 'hit' != 'miss'
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_miss_without_auth - AssertionError: 'hit' != 'miss'
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_restricted - TypeError: Cannot encode None for key 'return_url' as POST data. Did you mean to pass an empty string or omit the value?
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_restricted_without_auth - TypeError: Cannot encode None for key 'return_url' as POST data. Did you mean to pass an empty string or omit the value?
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_skip - AssertionError: 'miss' != 'skip'
FAILED testproject/home/tests.py::WagtailCacheTest::test_page_skip_without_auth - AssertionError: 'miss' != 'skip'
FAILED testproject/home/tests.py::WagtailCacheTest::test_request_hook_any - AssertionError: 'hit' != 'miss'
FAILED testproject/home/tests.py::WagtailCacheTest::test_response_hook_any - AssertionError: 'hit' != 'miss'

Originally posted by @KlausFuchs in #22 (comment)