Skip to content
Snippets Groups Projects
Commit ccf47022 authored by Jan Bernoth's avatar Jan Bernoth
Browse files

tests user creation

parent cb0c508e
No related branches found
No related tags found
1 merge request!122User centric api
......@@ -77,7 +77,7 @@ pylint:
extends: .remote_docker
stage: static_analysis
script:
- "docker run --rm $PIPELINEIMAGE pylint --rcfile=.pylintrc --load-plugins pylint_django --django-settings-module=one_api.settings_test */*.py */*/*.py"
- "docker run --rm $PIPELINEIMAGE pylint --rcfile=.pylintrc --load-plugins pylint_django --django-settings-module=one_api.settings_prod */*.py */*/*.py"
allow_failure: true
except:
refs:
......@@ -118,7 +118,7 @@ test-coverage-container:
extends: .test-coverage-container
stage: test_container
script:
- docker run --rm $PIPELINEIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_test; coverage report */*.py */*/*.py"
- docker run --rm $PIPELINEIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_prod; coverage report */*.py */*/*.py"
except:
refs:
- tags
......@@ -128,7 +128,7 @@ test-coverage-container-prod:
extends: .test-coverage-container
stage: test_container_prod
script:
- docker run --rm $APPIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_test; coverage report */*.py */*/*.py"
- docker run --rm $APPIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_prod; coverage report */*.py */*/*.py"
only:
- master
except:
......@@ -143,7 +143,7 @@ test-coverage-container-prod:
test-container:
extends: .test-container
script:
- docker run --rm $PIPELINEIMAGE python manage.py test --no-input --settings=one_api.settings_test
- docker run --rm $PIPELINEIMAGE python manage.py test --no-input --settings=one_api.settings_prod
except:
refs:
- tags
......@@ -153,7 +153,7 @@ test-container-prod:
extends: .test-container
stage: test_container_prod
script:
- docker run --rm $APPIMAGE python manage.py test --no-input --settings=one_api.settings_test
- docker run --rm $APPIMAGE python manage.py test --no-input --settings=one_api.settings_prod
only:
- master
except:
......
......@@ -6,6 +6,7 @@ from unittest import mock
from django.db.models.signals import post_save
from django.test import TransactionTestCase
from articles.apps import ArticlesConfig
from articles.models import Article, MediumType, Medium, Files, User
from articles.serializers import MediumTypeSerializer, MediumSerializer, ArticleSerializer
......@@ -106,6 +107,12 @@ class ArticleTest(TransactionTestCase):
class OverviewTest(TransactionTestCase):
def test_user(self):
""" test functions for REST API Overview"""
def test_create_user_app_conf(self):
""" tests if user were created if config is ready"""
logger.info("started OverviewTest.test_create_user_app_conf")
conf = ArticlesConfig.create('articles.apps.ArticlesConfig')
conf.ready()
user = User.objects.get(id_tag=1)
self.assertTrue(user.activated)
......@@ -23,7 +23,6 @@ class CropPRIntegration(TransactionTestCase):
def test_crop_file(self):
""" tests the cropping algorithm in a whole file"""
logger.info("started test_crop_file")
dir_path = '/app/articles/data_extraction/'
test_var = False
......
......@@ -50,8 +50,8 @@ class Manipulator(TestCase):
def test_deactivate_one_user(self):
""" tests how one user can be deactivated"""
logger.info("started Manipulator.test_deactivate_one_user")
create_users_in_db(1)
user = User.objects.get(id=1)
ids = create_users_in_db(1)
user = User.objects.get(id_tag=ids[0])
deactivate_user(user.id)
self.assertEqual(User.objects.filter(activated=False).count(), 1)
self.assertEqual(User.objects.filter(activated=True).count(), 0)
......
GRANT ALL PRIVILEGES ON *.* TO 'django'@'%';
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment