Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
Archweb
Commits
90c5d589
Unverified
Commit
90c5d589
authored
Sep 08, 2018
by
Jelle van der Waa
🚧
Committed by
GitHub
Sep 08, 2018
Browse files
Merge pull request #139 from jelly/tests
Clean up models on tearDown.
parents
e4de4d3b
3cef8311
Changes
1
Hide whitespace changes
Inline
Side-by-side
mirrors/tests/test_mirrorstatus.py
View file @
90c5d589
...
@@ -9,20 +9,15 @@ def test_status(self):
...
@@ -9,20 +9,15 @@ def test_status(self):
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
def
test_json_endpoint
(
self
):
def
test_json_endpoint
(
self
):
response
=
self
.
client
.
get
(
'/mirrors/status/json/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
data
=
response
.
json
()
self
.
assertEqual
(
data
[
'urls'
],
[])
mirror_url
=
create_mirror_url
()
# Verify that the cache works
response
=
self
.
client
.
get
(
'/mirrors/status/json/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
data
=
response
.
json
()
# Disables the cache_function's cache
# Disables the cache_function's cache
with
self
.
settings
(
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.dummy.DummyCache'
}}):
with
self
.
settings
(
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.dummy.DummyCache'
}}):
response
=
self
.
client
.
get
(
'/mirrors/status/json/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
data
=
response
.
json
()
self
.
assertEqual
(
data
[
'urls'
],
[])
mirror_url
=
create_mirror_url
()
response
=
self
.
client
.
get
(
'/mirrors/status/json/'
)
response
=
self
.
client
.
get
(
'/mirrors/status/json/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
data
=
response
.
json
()
data
=
response
.
json
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment