django-cookie-consent icon indicating copy to clipboard operation
django-cookie-consent copied to clipboard

Fix middleware

Open some1ataplace opened this issue 2 years ago • 2 comments

Solves #13 and #33

some1ataplace avatar Mar 05 '22 03:03 some1ataplace

Can you please add (regression) tests?

sergei-maertens avatar Mar 15 '22 16:03 sergei-maertens

We would probably need to do something like this:

Database values for cookie name, path, and domain must match the third party cookie values that are stored in your browser. You must also have the middleware inserted in your settings.py.

    MIDDLEWARE = [
        'cookie_consent.middleware.CleanCookiesMiddleware',
    ]

Test 1: Create cookie group Accept cookie group Populate third party cookies in the browser Delete cookie_consent cookie

Test 2: Create cookie group Accept cookie group Populate third party cookies in the browser Decline cookie group

To get started with tests do the following:

Download the entire zip file of django-cookie-consent pip3 install django-appconf cd Downloads/django-cookie-consent-master python3 -m pipenv shell Make a file inside Downloads/django-cookie-consent-master/tests/core/tests called test_middleware.py with class MiddlewareTest python3 manage.py test core.tests.test_middleware.MiddlewareTest

@sergei-maertens - Please check the tests I made.

some1ataplace avatar Mar 20 '22 02:03 some1ataplace