Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8391413
test_views.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
test_views.py
View Options
# Copyright (C) 2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
django.templatetags.static
import
static
from
swh.web.tests.helpers
import
check_html_get_response
,
check_http_get_response
from
swh.web.utils
import
reverse
from
swh.web.webapp.urls
import
SWH_FAVICON
def
test_homepage_view
(
client
):
url
=
reverse
(
"swh-web-homepage"
)
check_html_get_response
(
client
,
url
,
status_code
=
200
,
template_used
=
"homepage.html"
)
def
test_stat_counters_view
(
client
):
url
=
reverse
(
"stat-counters"
)
check_http_get_response
(
client
,
url
,
status_code
=
200
)
def
test_js_reverse_view
(
client
):
url
=
reverse
(
"js-reverse"
)
check_http_get_response
(
client
,
url
,
status_code
=
200
)
def
test_favicon_view
(
client
):
url
=
reverse
(
"favicon"
)
resp
=
check_http_get_response
(
client
,
url
,
status_code
=
301
)
assert
resp
[
"location"
]
==
static
(
SWH_FAVICON
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jun 4 2025, 6:43 PM (14 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239051
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment