Skip to content

Commit d3666a3

Browse files
committed
Merge branch 'tests-python'
2 parents 74bfcac + 79bfcbf commit d3666a3

File tree

10 files changed

+41
-2
lines changed

10 files changed

+41
-2
lines changed

django/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GEMEINDESCAN_WEBUI_DJANGO=0.3.3
1+
GEMEINDESCAN_WEBUI_DJANGO=0.3.4
22
DOCKER_EXEC=$(shell command -v docker > /dev/null && echo "docker-compose exec django")
33

44
.PHONY: all

django/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
3+
from django.core.management import call_command
4+
5+
@pytest.fixture(scope='session')
6+
def django_db_setup(django_db_setup, django_db_blocker):
7+
with django_db_blocker.unblock():
8+
call_command('loaddata', 'fixtures-tests/sites.site.json')
9+
call_command('loaddata', 'fixtures-tests/gsuser.user.json')
10+
call_command('loaddata', 'fixtures-tests/gsmap.municipality.json')
11+
call_command('loaddata', 'fixtures-tests/gsmap.snapshot.json')

django/docker/django/requirements/02.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pylint-django==2.0.13
4242
pylint-plugin-utils==0.6
4343
pyparsing==2.4.6
4444
pytest==5.3.5
45+
pytest-django==3.9.0
4546
pytz==2019.3
4647
requests==2.23.0
4748
Rx==1.6.1

django/fixtures-tests/gsmap.municipality.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

django/fixtures-tests/gsmap.snapshot.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"model": "gsuser.user", "pk": 1, "fields": {"password": "pbkdf2_sha256$180000$0wINEkSnlTLQ$cKkWUQGHdT4/pT9KcNzOZ+XS0LNw8Wx4VF4tuZ1oXkE=", "last_login": "2020-05-10T16:16:58.410Z", "is_superuser": true, "username": "admin", "first_name": "", "last_name": "", "email": "[email protected]", "is_staff": true, "is_active": true, "date_joined": "2020-05-10T16:11:16.244Z", "groups": [], "user_permissions": []}}]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"model": "sites.site", "pk": 1, "fields": {"domain": "localhost:8081", "name": "localhost:8081"}}]

django/main/settings_tests.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from .settings import *
2+
3+
SECRET_KEY = "#7r1uf5su86d($ita6venjygkru5zfe0)bkj68x0e8*)w6nar6"
4+
DEBUG = True
5+
USE_HTTPS = False
6+
7+
DATABASES = {
8+
'default': {
9+
'ENGINE': 'django.contrib.gis.db.backends.postgis',
10+
'NAME': 'webui-tests ',
11+
'USER': os.getenv('DJANGO_DB_USER'),
12+
'PASSWORD': os.getenv('DJANGO_DB_PASSWORD'),
13+
'HOST': os.getenv('DJANGO_DB_HOST', 'pdb'),
14+
'PORT': '5432',
15+
'CONN_MAX_AGE': 600,
16+
# 'OPTIONS': {'autocommit': True}
17+
}
18+
}
19+
20+
SAVE_SCREENSHOT_ENABLED = False

django/pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
DJANGO_SETTINGS_MODULE = main.settings_tests
3+
python_files = tests.py test_*.py *_tests.py

docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ services:
1010
hostname: vue
1111

1212
django:
13-
image: smartuse/gemeindescan-webui-django:0.3.3
13+
image: smartuse/gemeindescan-webui-django:0.3.4
1414
hostname: django

0 commit comments

Comments
 (0)