mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Add consent class and test
This commit is contained in:
parent
0e826aa1bd
commit
11564d8cfc
2 changed files with 7 additions and 2 deletions
|
|
@ -46,8 +46,8 @@ VARIABLE_CODE = (
|
|||
IDENTITY_CODE = '_paq.push(["setUserId", "%(userid)s"]);'
|
||||
DISABLE_COOKIES_CODE = "_paq.push(['disableCookies']);"
|
||||
|
||||
GIVE_CONSENT_CLASS = "matomo_give_consent"
|
||||
REMOVE_CONSENT_CLASS = "matomo_remove_consent"
|
||||
GIVE_CONSENT_CLASS = 'matomo_give_consent'
|
||||
REMOVE_CONSENT_CLASS = 'matomo_remove_consent'
|
||||
ASK_FOR_CONSENT_CODE = """
|
||||
_paq.push(['requireConsent']);
|
||||
|
||||
|
|
|
|||
|
|
@ -159,3 +159,8 @@ class MatomoTagTestCase(TagTestCase):
|
|||
def test_disable_cookies(self):
|
||||
r = MatomoNode().render(Context({}))
|
||||
assert "_paq.push(['disableCookies']);" in r
|
||||
|
||||
@override_settings(MATOMO_ASK_FOR_CONSENT=True)
|
||||
def test_ask_for_consent(self):
|
||||
r = MatomoNode().render(Context({}))
|
||||
self.assertTrue("_paq.push(['requireConsent']);" in r, r)
|
||||
|
|
|
|||
Loading…
Reference in a new issue