Skip to content

Commit edd539f

Browse files
truly fix the django warning in tests
1 parent c661cef commit edd539f

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ log_file = "logs/pytest.log"
4646
log_file_level = "DEBUG"
4747
log_format = "%(asctime)s %(levelname)s %(message)s"
4848
log_date_format = "%Y-%m-%d %H:%M:%S"
49-
filterwarnings = [
50-
"ignore:\"@coroutine\" decorator is deprecated since Python 3.8, use \"async def\" instead:DeprecationWarning",
51-
"ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning",
52-
"ignore:Unknown config option. asyncio_mode:pytest.PytestConfigWarning", # ignore warning when asyncio_mode is set but pytest-asyncio is not installed
53-
]
49+
filterwarnings = []
5450
asyncio_mode = "auto"
5551

5652
[tool.mypy]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
3+
import django
4+
5+
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.adapter_tests.django.test_django_settings"
6+
django.setup()

tests/adapter_tests/django/test_django.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import os
32
from time import time
43
from urllib.parse import quote
54

@@ -29,7 +28,6 @@ class TestDjango(TestCase):
2928
base_url=mock_api_server_base_url,
3029
)
3130

32-
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.adapter_tests.django.test_django_settings"
3331
rf = RequestFactory()
3432

3533
def setUp(self):

tests/adapter_tests/django/test_django_settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
DATABASES = {
33
"default": {
44
"ENGINE": "django.db.backends.sqlite3",
5-
"NAME": ":memory:",
5+
"NAME": "logs/db.sqlite3",
66
}
77
}
8-
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
98
# Django 4 warning: The default value of USE_TZ will change from False to True in Django 5.0.
109
# Set USE_TZ to False in your project settings if you want to keep the current default behavior.
1110
USE_TZ = False

0 commit comments

Comments
 (0)