coderedcorp / wagtail-cache

A simple page cache for Wagtail based on the Django cache middleware.
Other
87 stars 29 forks source link

unit tests are all broken #25

Closed marcus-steinbach closed 3 years ago

marcus-steinbach commented 3 years ago

(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 https://github.com/coderedcorp/wagtail-cache/issues/22#issuecomment-741618359