Skip to content

Commit

Permalink
testing dir change
Browse files Browse the repository at this point in the history
added linting tools

added dev requirement file

updated install

testing tests

added cp of .env file

checking enviroment files

testing cat

fixed cat command

testing tests

testing location

testing django-environ

fixed install

added new install

added test requiment file

updated requirement file

fixed dir

testing sqlight tests

added make dir

cleaned up code
  • Loading branch information
daniel-gray-tangent committed Apr 29, 2024
1 parent 9bffa12 commit 0044fb2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .env.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SECRET_KEY='django-insecure-w!h85bp^$$e8gm%c23r!0%9i7yzd=6w$$s&ic+6!%306&kj8@k*5'
DEBUG=True
DB_HOST=db
DB_PORT=5432
DB_NAME=term_db
DB_USER=sadilar
DB_PASSWORD=sadilar
LOGGING_FILE=logs/debug.log
LOGGING_HANDLERS_LEVEL=INFO
LOGGING_LOGGERS_LEVEL=INFO
LOGGING_LOGGERS_DJANGO_LEVEL=INFO
14 changes: 10 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test_Django
name: Testing Django
on: [ pull_request, push ] # activates the workflow when there is a push or pull request in the repo
jobs:
test_project:
Expand All @@ -9,8 +9,14 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: Run linting tools
run: |
cd app/
ruff format .
- name: Run Tests
run: |
ls -al
# python manage.py test
cp .env.testing app/.env
cd app/
mkdir static_files
python manage.py test
9 changes: 9 additions & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
"""

import os
import sys
from pathlib import Path

import environ

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

# Take environment variables from .env file
environ.Env.read_env(os.path.join(BASE_DIR, ".env"))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

Expand Down Expand Up @@ -96,6 +102,9 @@
}
}

if "test" in sys.argv or "test_coverage" in sys.argv: # Covers regular testing and django-coverage
DATABASES["default"]["ENGINE"] = "django.db.backends.sqlite3"

# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators

Expand Down
3 changes: 3 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements.txt
django-extensions
ruff
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ django==5.0.2
psycopg2-binary
gunicorn
whitenoise
django-environ

0 comments on commit 0044fb2

Please sign in to comment.