Refactor endpoint tests
Replace force_login calls with login call from client class in setUp
This commit is contained in:
parent
61702e720a
commit
858f84aaad
132 changed files with 5158 additions and 661 deletions
|
|
@ -1,13 +1,57 @@
|
|||
services:
|
||||
- postgres:9.6
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- lint
|
||||
|
||||
variables:
|
||||
POSTGRES_DB: newsreader
|
||||
POSTGRES_USER: newsreader
|
||||
javascript build:
|
||||
image: node:12
|
||||
stage: build
|
||||
cache:
|
||||
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
- node_modules/
|
||||
before_script:
|
||||
- npm install --dev
|
||||
script:
|
||||
- npx gulp
|
||||
|
||||
python tests:
|
||||
services:
|
||||
- postgres:11
|
||||
image: python:3.7.4-slim-stretch
|
||||
stage: test
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
DJANGO_SETTINGS_MODULE: "newsreader.conf.gitlab"
|
||||
POSTGRES_DB: newsreader
|
||||
POSTGRES_USER: newsreader
|
||||
cache:
|
||||
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
- .cache/pip
|
||||
- env/
|
||||
before_script:
|
||||
- python3 -m venv env
|
||||
- source env/bin/activate
|
||||
- pip install -r requirements/gitlab.txt
|
||||
script:
|
||||
- python src/manage.py test newsreader
|
||||
|
||||
javascript linting:
|
||||
image: node:12
|
||||
stage: lint
|
||||
cache:
|
||||
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
- node_modules/
|
||||
before_script:
|
||||
- npm install --dev
|
||||
script:
|
||||
- npm run lint
|
||||
|
||||
python linting:
|
||||
image: python:3.7.4-slim-stretch
|
||||
stage: lint
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
DJANGO_SETTINGS_MODULE: "newsreader.conf.gitlab"
|
||||
|
|
@ -21,6 +65,6 @@ python tests:
|
|||
- source env/bin/activate
|
||||
- pip install -r requirements/gitlab.txt
|
||||
script:
|
||||
- python src/manage.py test newsreader
|
||||
- isort -rc src/ --check-only
|
||||
- black -l 90 --check src/
|
||||
- autoflake -rc src/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue