Skip to content

Commit ffe7680

Browse files
committed
add some views for manual testing
1 parent 26b75a1 commit ffe7680

File tree

6 files changed

+29
-0
lines changed

6 files changed

+29
-0
lines changed

tests/settings/sqlite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@
3636
]
3737

3838
USE_TZ = False
39+
40+
ROOT_URLCONF = "tests.settings.urls"

tests/settings/sqlite_async.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@
4545
]
4646

4747
USE_TZ = False
48+
49+
ROOT_URLCONF = "tests.settings.urls"

tests/settings/sqlite_async_herd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@
3737
CACHE_HERD_TIMEOUT = 2
3838

3939
USE_TZ = False
40+
41+
ROOT_URLCONF = "tests.settings.urls"

tests/settings/sqlite_async_sentinel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@
4545
INSTALLED_APPS = ["django.contrib.sessions"]
4646

4747
USE_TZ = False
48+
49+
ROOT_URLCONF = "tests.settings.urls"

tests/settings/sqlite_async_sentinel_opts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@
4747
INSTALLED_APPS = ["django.contrib.sessions"]
4848

4949
USE_TZ = False
50+
51+
ROOT_URLCONF = "tests.settings.urls"

tests/settings/urls.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from django.core.cache import cache
2+
from django.http import HttpResponse
3+
from django.urls import path
4+
5+
6+
async def async_view(request):
7+
res = await cache.get("a")
8+
return HttpResponse(res)
9+
10+
11+
async def sync_view(request):
12+
res = cache.get("a")
13+
return HttpResponse(res)
14+
15+
16+
urlpatterns = [
17+
path("async/", async_view),
18+
path("sync/", sync_view),
19+
]

0 commit comments

Comments
 (0)