Tests / fedidevs/tests.py
TestAnonymousCacheAndCsrf::test_authenticated_html_is_private_and_keeps_csrf_header
First seen 12 hours ago in 0c23747
CI
github-actions:test
4 runs
Average
1.75 s
median 2.01 s
max 2.12 s
max 2.12 s
Phases
Setup 5 ms
Call 1.75 s
Teardown 0.62 ms
Categories
Password hashing 1.60 s
Database 38 ms
App code 0.55 ms
Other (Libraries, pytest, Templates, Unsampled) 109 ms
31 database queries per run
Needs 4 KB of memory (max 8 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 7 hours ago ·
open run
call867 ms99.9%
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:62 User.objects.create_user("alice", password="pw")421 ms48.4%
UserManager.create_userdjango/contrib/auth/models.py:180421 ms48.4%
UserManager._create_userdjango/contrib/auth/models.py:167417 ms48.1%
UserManager._create_user_objectdjango/contrib/auth/models.py:160417 ms48.1%
make_passworddjango/contrib/auth/hashers.py:118417 ms48.1%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333417 ms48.1%
pbkdf2django/utils/crypto.py:93417 ms48.1%
1 smaller frames hidden
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:63 self.client.login(username="alice", password="pw")390 ms44.9%
ClientMixin.logindjango/test/client.py:838378 ms43.5%
sensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperdjango/views/decorators/debug.py:74378 ms43.5%
authenticatedjango/contrib/auth/__init__.py:130378 ms43.5%
sensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperdjango/views/decorators/debug.py:74378 ms43.5%
ModelBackend.authenticatedjango/contrib/auth/backends.py:75375 ms43.2%
check_password_with_timing_attack_mitigationdjango/contrib/auth/__init__.py:399375 ms43.2%
AbstractBaseUser.check_passworddjango/contrib/auth/base_user.py:109375 ms43.2%
check_passworddjango/contrib/auth/hashers.py:83375 ms43.2%
verify_passworddjango/contrib/auth/hashers.py:63375 ms43.2%
PBKDF2PasswordHasher.verifydjango/contrib/auth/hashers.py:349375 ms43.2%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333375 ms43.2%
pbkdf2django/utils/crypto.py:93375 ms43.2%
1 smaller frames hidden
ClientMixin.logindjango/test/client.py:84013 ms1.4%
ClientMixin._logindjango/test/client.py:8896 ms0.7%
ClientMixin._logindjango/test/client.py:8845 ms0.6%
ClientMixin.sessiondjango/test/client.py:8155 ms0.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1215 ms0.6%
1 smaller frames hidden
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:64 response = self.client.get("/conferences/")56 ms6.4%
Client.getdjango/test/client.py:113356 ms6.4%
RequestFactory.getdjango/test/client.py:47556 ms6.4%
RequestFactory.genericdjango/test/client.py:67156 ms6.4%
Client.requestdjango/test/client.py:109156 ms6.4%
ClientHandler.__call__django/test/client.py:18629 ms3.4%
BaseHandler.get_responsedjango/core/handlers/base.py:14229 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12329 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14529 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38029 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5629 ms3.4%
BaseHandler._get_responsedjango/core/handlers/base.py:19929 ms3.4%
conferencesconfs/views.py:128 return render(22 ms2.5%
renderdjango/shortcuts.py:2722 ms2.5%
render_to_stringdjango/template/loader.py:6222 ms2.5%
Template.renderdjango/template/backends/django.py:10722 ms2.5%
Template.renderdjango/template/base.py:17522 ms2.5%
instrumented_test_renderdjango/test/utils.py:11322 ms2.5%
NodeList.renderdjango/template/base.py:110822 ms2.5%
Node.render_annotateddjango/template/base.py:106922 ms2.5%
ExtendsNode.renderdjango/template/loader_tags.py:16022 ms2.5%
instrumented_test_renderdjango/test/utils.py:11322 ms2.5%
NodeList.renderdjango/template/base.py:110822 ms2.5%
Node.render_annotateddjango/template/base.py:106922 ms2.5%
BlockNode.renderdjango/template/loader_tags.py:6618 ms2.1%
NodeList.renderdjango/template/base.py:110818 ms2.1%
Node.render_annotateddjango/template/base.py:106918 ms2.1%
IfNode.renderdjango/template/defaulttags.py:33216 ms1.8%
QuerySet.__bool__django/db/models/query.py:45316 ms1.8%
QuerySet._fetch_alldjango/db/models/query.py:226212 ms1.3%
ModelIterable.__iter__django/db/models/query.py:10312 ms1.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162510 ms1.2%
CursorWrapper.executedjango/db/backends/utils.py:7910 ms1.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9210 ms1.2%
CursorWrapper._executedjango/db/backends/utils.py:1059 ms1.1%
Cursor.executepsycopg/cursor.py:1139 ms1.1%
Connection.waitpsycopg/connection.py:4959 ms1.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2068 ms1.0%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2868 ms1.0%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:788 ms1.0%
1 smaller frames hidden
1 smaller frames hidden
2 smaller frames hidden
3 smaller frames hidden
2 smaller frames hidden
ClientHandler.__call__django/test/client.py:17326 ms3.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6325 ms2.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10425 ms2.9%
WhiteNoise.add_fileswhitenoise/base.py:10825 ms2.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12019 ms2.2%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13119 ms2.2%
WhiteNoise.get_static_filewhitenoise/base.py:21713 ms1.4%
StaticFile.__init__whitenoise/responders.py:737 ms0.8%
4 smaller frames hidden
WhiteNoise.get_static_filewhitenoise/base.py:2125 ms0.6%
1 smaller frames hidden
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms0.6%
scantreewhitenoise/base.py:2715 ms0.6%
1 smaller frames hidden
1 smaller frames hidden
Estimated from 827 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
fedidevs/tests.py:62
User.objects.create_user("alice", password="pw")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Password hashing
|
421 ms |
|
fedidevs/tests.py:63
self.client.login(username="alice", password="pw")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Password hashing
|
390 ms |
|
fedidevs/tests.py:64
response = self.client.get("/conferences/")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Libraries
|
26 ms |
|
confs/views.py:128
return render(
conferences
· Database
|
22 ms |
|
confs/views.py:85
if request.user.is_authenticated:
conferences
· Database
|
4 ms |
|
confs/views.py:41
for al in ConferenceLookup.objects.values("language").annotate(count=Count("language")).order_by("-count")
conferences
· Database
|
3 ms |
|
fedidevs/tests.py:68
self.assertNotContains(response, "data-csrf-url")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Libraries
|
1 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.18 ms |
| _template_string_if_invalid_marker function | 0.06 ms |
| _django_db_marker function | 0.04 ms |
| _django_isolate_apps function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
31 queries · 35 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
SELECT "confs_conference"."id", "confs_conference"."name", "confs_conference"."slug", "confs_conference"."location", "confs_conference"."start_date", "confs_conference"."end_date", "confs_conference"."time_zone", "confs_conference"."archived_date", "confs_conference"."approved_at", "confs_conferenc…
Biggest pieces of work
|
call test body
fedidevs/tests.py:62
|
867 ms |
Reliability
5 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 5 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 7 hours ago | CI github-actions:test | passed | 869 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 2.00 s | Profile |
| 7 hours ago | CI github-actions:test | passed | 2.12 s | Profile |
| 12 hours ago | CI github-actions:test | passed | 2.02 s | Profile |
| 12 hours ago | CI github-actions:test | passed | 1.17 s | Run |