added coverage dependency; 99 percent test coverage (only lacking admin, currently by design); commenced postgresql db integration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
8
src/.coveragerc
Normal file
8
src/.coveragerc
Normal file
@@ -0,0 +1,8 @@
|
||||
[run]
|
||||
source = apps
|
||||
omit =
|
||||
*/migrations/*
|
||||
*/tests/*
|
||||
|
||||
[report]
|
||||
show_missing = true
|
||||
@@ -10,3 +10,8 @@ class SimpleAuthenticateTest(SimpleTestCase):
|
||||
HttpRequest(), "no-such-token"
|
||||
)
|
||||
self.assertIsNone(result)
|
||||
|
||||
def test_returns_None_if_no_uuid(self):
|
||||
result = PasswordlessAuthenticationBackend().authenticate(HttpRequest())
|
||||
self.assertIsNone(result)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/6.0/ref/settings/
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
import dj_database_url
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
@@ -26,13 +27,11 @@ if 'DJANGO_DEBUG_FALSE' in os.environ:
|
||||
DEBUG = False
|
||||
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
|
||||
ALLOWED_HOSTS = [host.strip() for host in os.environ['DJANGO_ALLOWED_HOST'].split(',')]
|
||||
db_path = os.environ['DJANGO_DB_PATH']
|
||||
else:
|
||||
DEBUG = True
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-&9b_h=qpjy=sshhnsyg98&jp7(t6*v78__y%h2l$b#_@6z$-9r'
|
||||
ALLOWED_HOSTS = []
|
||||
db_path = BASE_DIR / 'db.sqlite3'
|
||||
|
||||
|
||||
# Application definition
|
||||
@@ -90,12 +89,16 @@ ASGI_APPLICATION = 'core.asgi.application'
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': db_path,
|
||||
DATABASE_URL = os.environ.get('DATABASE_URL')
|
||||
if DATABASE_URL:
|
||||
DATABASES = {'default': dj_database_url.config(conn_max_age=600)}
|
||||
else:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': BASE_DIR / 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
|
||||
Reference in New Issue
Block a user