From bd19f62f21a458fe1926c7e83c4c9bbee86b6bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com> Date: Fri, 24 Apr 2020 14:29:20 +0200 Subject: [PATCH] Fix tests setup --- pirates/urls.py | 0 setup.cfg | 2 +- tests/conftest.py | 6 ++++++ tests/factories.py | 4 +--- tests/settings.py | 5 ++++- 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 pirates/urls.py create mode 100644 tests/conftest.py diff --git a/pirates/urls.py b/pirates/urls.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg index 91d8bea..69f5ac9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,4 +12,4 @@ line_length = 88 multi_line_output = 3 default_sectiont = "THIRDPARTY" include_trailing_comma = true -known_third_party =django,factory,faker,mozilla_django_oidc,pytest,setuptools +known_third_party =django,factory,faker,mozilla_django_oidc,pytest,pytest_factoryboy,setuptools diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..cd3e591 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,6 @@ +from pytest_factoryboy import register + +from .factories import TeamFactory, UserFactory + +register(UserFactory) +register(TeamFactory) diff --git a/tests/factories.py b/tests/factories.py index d1f5278..dff336c 100644 --- a/tests/factories.py +++ b/tests/factories.py @@ -1,5 +1,3 @@ -from typing import Any, Sequence - from django.contrib.auth import get_user_model from factory import DjangoModelFactory, Faker, post_generation @@ -11,7 +9,7 @@ class UserFactory(DjangoModelFactory): email = Faker("email") @post_generation - def password(self, create: bool, extracted: Sequence[Any], **kwargs): + def password(self, create, extracted, **kwargs): password = Faker( "password", length=42, diff --git a/tests/settings.py b/tests/settings.py index 80fdb2d..042a157 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -23,4 +23,7 @@ SESSION_ENGINE = "django.contrib.sessions.backends.cache" MIDDLEWARE = [] -OIDC_USERNAME_ALGO = None +OIDC_RP_CLIENT_ID = "" +OIDC_RP_CLIENT_SECRET = "" +OIDC_OP_TOKEN_ENDPOINT = "" +OIDC_OP_USER_ENDPOINT = "" -- GitLab