mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Use pytest for tests (#681)
* use pytest for tests Eh ouais, il y a que la config qui change. Pytest est implémentable par étapes. Et ça c'est beau. * rework tests with pytest * remove unittest custom TestRunner * Edit doc and CI
This commit is contained in:
@ -57,6 +57,7 @@ SECRET_KEY = "(4sjxvhz@m5$0a$j0_pqicnc$s!vbve)z+&++m%g%bjhlz4+g2"
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = False
|
||||
TESTING = "pytest" in sys.modules
|
||||
INTERNAL_IPS = ["127.0.0.1"]
|
||||
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
@ -113,8 +114,6 @@ MIDDLEWARE = (
|
||||
"core.middleware.SignalRequestMiddleware",
|
||||
)
|
||||
|
||||
TEST_RUNNER = "sith.testrunner.SithTestRunner"
|
||||
|
||||
ROOT_URLCONF = "sith.urls"
|
||||
|
||||
TEMPLATES = [
|
||||
@ -697,7 +696,7 @@ if DEBUG:
|
||||
SASS_INCLUDE_FOLDERS = ["core/static/"]
|
||||
SENTRY_ENV = "development"
|
||||
|
||||
if "test" in sys.argv:
|
||||
if TESTING:
|
||||
CAPTCHA_TEST_MODE = True
|
||||
|
||||
if SENTRY_DSN:
|
||||
|
@ -1,9 +0,0 @@
|
||||
from django.core.management import call_command
|
||||
from django.test.runner import DiscoverRunner
|
||||
|
||||
|
||||
class SithTestRunner(DiscoverRunner):
|
||||
def setup_databases(self, **kwargs):
|
||||
res = super().setup_databases(**kwargs)
|
||||
call_command("populate")
|
||||
return res
|
Reference in New Issue
Block a user