This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
102 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
language: python | ||
dist: xenial | ||
sudo: false | ||
language: python | ||
cache: pip | ||
|
||
python: | ||
- "3.6" | ||
- "3.5" | ||
- "2.7" | ||
env: | ||
- REQ="Django>=1.10,<1.11" | ||
- REQ="Django>=1.11,<2.0" | ||
- REQ="Django>=2.0,<2.1" | ||
- 3.7 | ||
matrix: | ||
exclude: | ||
- python: '2.7' | ||
fast_finish: true | ||
include: | ||
- python: 3.7 | ||
env: REQ="https://github.com/django/django/archive/master.zip#egg=Django" | ||
- python: 3.7 | ||
env: REQ="Django>=2.2,<3.0" | ||
- python: 3.6 | ||
env: REQ="Django>=2.2,<3.0" | ||
- python: 3.5 | ||
env: REQ="Django>=2.2,<3.0" | ||
- python: 3.7 | ||
env: REQ="Django>=2.1,<2.2" | ||
- python: 3.7 | ||
env: REQ="Django>=2.0,<2.1" | ||
- python: 3.7 | ||
env: REQ="Django>=1.11,<2.0" | ||
- python: 3.6 | ||
env: REQ="Django>=1.11,<2.0" | ||
- python: 3.5 | ||
env: REQ="Django>=1.11,<2.0" | ||
- python: 3.4 | ||
env: REQ="Django>=1.11,<2.0" | ||
- python: 3.7 | ||
env: REQ="black flake8" | ||
install: skip | ||
script: | ||
- pip install black flake8 | ||
- flake8 . | ||
- black --check privacy_killer tests | ||
install: | ||
- pip install -U pip wheel | ||
- pip install $REQ flake8 | ||
- pip install $REQ | ||
- python setup.py install | ||
# command to run tests, e.g. python setup.py test | ||
script: "cd tests && ./manage.py test testapp && cd .. && flake8 ." | ||
script: cd tests && ./manage.py test -v2 testapp |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
VERSION = (0, 1, 0) | ||
__version__ = '.'.join(map(str, VERSION)) | ||
__version__ = ".".join(map(str, VERSION)) |
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 |
---|---|---|
@@ -1,38 +1,28 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
import os | ||
|
||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': ':memory:', | ||
} | ||
} | ||
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}} | ||
|
||
INSTALLED_APPS = [ | ||
'testapp', | ||
'privacy_killer', | ||
] | ||
INSTALLED_APPS = ["testapp", "privacy_killer"] | ||
|
||
BASEDIR = os.path.dirname(__file__) | ||
SECRET_KEY = 'supersikret' | ||
SECRET_KEY = "supersikret" | ||
# ROOT_URLCONF = 'testapp.urls' | ||
ALLOWED_HOSTS = ['*'] | ||
ALLOWED_HOSTS = ["*"] | ||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
], | ||
"BACKEND": "django.template.backends.django.DjangoTemplates", | ||
"DIRS": [], | ||
"APP_DIRS": True, | ||
"OPTIONS": { | ||
"context_processors": [ | ||
"django.template.context_processors.debug", | ||
"django.template.context_processors.request", | ||
"django.contrib.auth.context_processors.auth", | ||
"django.contrib.messages.context_processors.messages", | ||
] | ||
}, | ||
}, | ||
} | ||
] |
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 |
---|---|---|
@@ -1,53 +1,28 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
from django.test import TestCase | ||
from django.test.utils import override_settings | ||
|
||
from privacy_killer.templatetags.privacy_killer import ( | ||
privacy_killer_body, privacy_killer_head, | ||
privacy_killer_body, | ||
privacy_killer_head, | ||
) | ||
|
||
|
||
@override_settings( | ||
PRIVACY_KILLER_IDS=[], | ||
) | ||
@override_settings(PRIVACY_KILLER_IDS=[]) | ||
class NotUsed(TestCase): | ||
def test_tag(self): | ||
self.assertEqual( | ||
privacy_killer_head(), | ||
'', | ||
) | ||
self.assertEqual( | ||
privacy_killer_body(), | ||
'', | ||
) | ||
self.assertEqual(privacy_killer_head(), "") | ||
self.assertEqual(privacy_killer_body(), "") | ||
|
||
|
||
@override_settings( | ||
PRIVACY_KILLER_IDS=['GTM-bla'], | ||
) | ||
@override_settings(PRIVACY_KILLER_IDS=["GTM-bla"]) | ||
class GTM(TestCase): | ||
def test_tag(self): | ||
self.assertIn( | ||
'<!-- Google Tag Manager -->\n<script>', | ||
privacy_killer_head(), | ||
) | ||
self.assertIn( | ||
'<!-- Google Tag Manager (noscript) -->', | ||
privacy_killer_body(), | ||
) | ||
self.assertIn("<!-- Google Tag Manager -->\n<script>", privacy_killer_head()) | ||
self.assertIn("<!-- Google Tag Manager (noscript) -->", privacy_killer_body()) | ||
|
||
|
||
@override_settings( | ||
PRIVACY_KILLER_IDS=['UA-bla'], | ||
) | ||
@override_settings(PRIVACY_KILLER_IDS=["UA-bla"]) | ||
class Analytics(TestCase): | ||
def test_tag(self): | ||
self.assertIn( | ||
'<!-- Google Analytics -->\n<script>', | ||
privacy_killer_head(), | ||
) | ||
self.assertEqual( | ||
privacy_killer_body(), | ||
'', | ||
) | ||
self.assertIn("<!-- Google Analytics -->\n<script>", privacy_killer_head()) | ||
self.assertEqual(privacy_killer_body(), "") |
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