From b2256090ca2bd213516320a7b9f35c2eab7bff3c Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Wed, 23 May 2018 11:58:50 +0200 Subject: [PATCH] Coverage for templates --- .coveragerc | 3 +++ .gitlab-ci.yml | 1 + config_local.py | 9 ++++++++- ivatar/ivataraccount/models.py | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..5dff2d8 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[run] +plugins = + django_coverage_plugin diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd9cd2d..d80364a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,7 @@ before_script: - pip install python-coveralls - pip install coverage - pip install pycco + - pip install django_coverage_plugin test_and_coverage: stage: test diff --git a/config_local.py b/config_local.py index 6be76e5..e42e0c0 100644 --- a/config_local.py +++ b/config_local.py @@ -1,3 +1,10 @@ -SESSION_COOKIE_SECURE = False +''' +Local config +''' + +from ivatar.settings import TEMPLATES # noqa + +SESSION_COOKIE_SECURE = False DEBUG = True SITE_URL = 'http://localhost:8383' +TEMPLATES[0]['OPTIONS']['debug'] = True diff --git a/ivatar/ivataraccount/models.py b/ivatar/ivataraccount/models.py index 7f20222..f83a208 100644 --- a/ivatar/ivataraccount/models.py +++ b/ivatar/ivataraccount/models.py @@ -84,7 +84,7 @@ class Photo(BaseAccountModel): image_url = gravatar['image_url'] if not image_url: - return False + return False # pragma: no cover try: image = urlopen(image_url) # No idea how to test this