Run Black over the whole codebase
This commit is contained in:
parent
cd990e4e2f
commit
2e7d12b3e6
109 changed files with 1539 additions and 1209 deletions
|
@ -5,22 +5,22 @@ import pytest
|
|||
|
||||
@pytest.mark.django_db
|
||||
def test_host_meta_json(client):
|
||||
res = client.get('/.well-known/host-meta.json')
|
||||
res = client.get("/.well-known/host-meta.json")
|
||||
assert res.status_code == 200
|
||||
assert res['Content-Type'] == 'application/json'
|
||||
assert res["Content-Type"] == "application/json"
|
||||
meta = json.loads(res.content)
|
||||
assert meta.keys() == {'links', 'subject'}
|
||||
assert meta['subject'] == 'https://example.com'
|
||||
assert len(meta['links']) == 13
|
||||
assert meta.keys() == {"links", "subject"}
|
||||
assert meta["subject"] == "https://example.com"
|
||||
assert len(meta["links"]) == 13
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_host_meta_xml(client):
|
||||
res = client.get('/.well-known/host-meta')
|
||||
res = client.get("/.well-known/host-meta")
|
||||
assert res.status_code == 200
|
||||
assert res['Content-Type'] == 'application/xrd+xml'
|
||||
assert res["Content-Type"] == "application/xrd+xml"
|
||||
root = etree.XML(res.content)
|
||||
ns = '{http://docs.oasis-open.org/ns/xri/xrd-1.0}'
|
||||
assert root.tag == (ns + 'XRD')
|
||||
assert root.findtext(ns + 'Subject') == 'https://example.com'
|
||||
assert len(root.findall(ns + 'Link')) == 13
|
||||
ns = "{http://docs.oasis-open.org/ns/xri/xrd-1.0}"
|
||||
assert root.tag == (ns + "XRD")
|
||||
assert root.findtext(ns + "Subject") == "https://example.com"
|
||||
assert len(root.findall(ns + "Link")) == 13
|
||||
|
|
|
@ -2,12 +2,12 @@ from ...views import static
|
|||
|
||||
|
||||
def test_redirect_to_static(rf):
|
||||
res = static.redirect_to_static('abcd')(rf.get('/'))
|
||||
res = static.redirect_to_static("abcd")(rf.get("/"))
|
||||
assert res.status_code == 302
|
||||
assert res.url == '/static/wellknowns/abcd'
|
||||
assert res.url == "/static/wellknowns/abcd"
|
||||
|
||||
|
||||
def test_keybase(rf):
|
||||
res = static.keybase(rf.get('/.well-knowns/keybase.txt'))
|
||||
res = static.keybase(rf.get("/.well-knowns/keybase.txt"))
|
||||
assert res.status_code == 302
|
||||
assert res.url == '/static/wellknowns/keybase.txt'
|
||||
assert res.url == "/static/wellknowns/keybase.txt"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue