forked from 00dani/lemoncurry
Add support for tests that use django.test.Client and that require a database, and use this support to test some of the wellknowns.views modules
This commit is contained in:
parent
380afe9831
commit
cbc24d4774
6 changed files with 44 additions and 1 deletions
13
wellknowns/tests/views/static.py
Normal file
13
wellknowns/tests/views/static.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from ...views import static
|
||||
|
||||
|
||||
def test_redirect_to_static(rf):
|
||||
res = static.redirect_to_static('abcd')(rf.get('/'))
|
||||
assert res.status_code == 302
|
||||
assert res.url == '/static/wellknowns/abcd'
|
||||
|
||||
|
||||
def test_keybase(rf):
|
||||
res = static.keybase(rf.get('/.well-knowns/keybase.txt'))
|
||||
assert res.status_code == 302
|
||||
assert res.url == '/static/wellknowns/keybase.txt'
|
Loading…
Add table
Add a link
Reference in a new issue