Tests / fedidevs/tests.py
TestAnonymousCacheAndCsrf::test_authenticated_html_is_private_and_keeps_csrf_header
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
1.28 s
median 1.19 s
max 2.12 s
max 2.12 s
Phases
Setup 2 ms
Call 1.27 s
Teardown 0.41 ms
Categories
Password hashing 1.15 s
Database 51 ms
App code 0.97 ms
Other (Libraries, Templates, pytest, Unsampled, ...) 76 ms
31 database queries per run
Needs 78 KB of memory (max 892 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call834 ms99.9%
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:70 self.client.login(username="alice", password="pw")393 ms47.1%
ClientMixin.logindjango/test/client.py:838386 ms46.2%
sensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperdjango/views/decorators/debug.py:74386 ms46.2%
authenticatedjango/contrib/auth/__init__.py:130386 ms46.2%
sensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperdjango/views/decorators/debug.py:74386 ms46.2%
ModelBackend.authenticatedjango/contrib/auth/backends.py:75382 ms45.7%
check_password_with_timing_attack_mitigationdjango/contrib/auth/__init__.py:399382 ms45.7%
AbstractBaseUser.check_passworddjango/contrib/auth/base_user.py:109382 ms45.7%
check_passworddjango/contrib/auth/hashers.py:83382 ms45.7%
verify_passworddjango/contrib/auth/hashers.py:63382 ms45.7%
PBKDF2PasswordHasher.verifydjango/contrib/auth/hashers.py:349382 ms45.7%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333382 ms45.7%
pbkdf2django/utils/crypto.py:93382 ms45.7%
1 smaller frames hidden
ClientMixin.logindjango/test/client.py:8407 ms0.9%
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:69 User.objects.create_user("alice", password="pw")383 ms45.8%
UserManager.create_userdjango/contrib/auth/models.py:180383 ms45.8%
UserManager._create_userdjango/contrib/auth/models.py:167379 ms45.3%
UserManager._create_user_objectdjango/contrib/auth/models.py:160379 ms45.3%
make_passworddjango/contrib/auth/hashers.py:118379 ms45.3%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333379 ms45.3%
pbkdf2django/utils/crypto.py:93379 ms45.3%
1 smaller frames hidden
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:71 response = self.client.get("/conferences/")58 ms7.0%
Client.getdjango/test/client.py:113358 ms7.0%
RequestFactory.getdjango/test/client.py:47558 ms7.0%
RequestFactory.genericdjango/test/client.py:67158 ms7.0%
Client.requestdjango/test/client.py:109158 ms7.0%
ClientHandler.__call__django/test/client.py:18648 ms5.7%
BaseHandler.get_responsedjango/core/handlers/base.py:14248 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12348 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14548 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38048 ms5.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5648 ms5.7%
BaseHandler._get_responsedjango/core/handlers/base.py:19948 ms5.7%
conferencesconfs/views.py:128 return render(48 ms5.7%
renderdjango/shortcuts.py:2748 ms5.7%
render_to_stringdjango/template/loader.py:6244 ms5.2%
Template.renderdjango/template/backends/django.py:10744 ms5.2%
Template.renderdjango/template/base.py:17544 ms5.2%
instrumented_test_renderdjango/test/utils.py:11344 ms5.2%
NodeList.renderdjango/template/base.py:110844 ms5.2%
Node.render_annotateddjango/template/base.py:106944 ms5.2%
ExtendsNode.renderdjango/template/loader_tags.py:16044 ms5.2%
instrumented_test_renderdjango/test/utils.py:11344 ms5.2%
NodeList.renderdjango/template/base.py:110844 ms5.2%
Node.render_annotateddjango/template/base.py:106944 ms5.2%
IfNode.renderdjango/template/defaulttags.py:33323 ms2.7%
NodeList.renderdjango/template/base.py:110823 ms2.7%
Node.render_annotateddjango/template/base.py:106923 ms2.7%
VariableNode.renderdjango/template/base.py:116723 ms2.7%
FilterExpression.resolvedjango/template/base.py:80623 ms2.7%
Variable.resolvedjango/template/base.py:94523 ms2.7%
Variable._resolve_lookupdjango/template/base.py:99323 ms2.7%
new_method_proxy.<locals>.innerdjango/utils/functional.py:25323 ms2.7%
ReverseOneToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:53723 ms2.7%
FetchOne.fetchdjango/db/models/fetch_modes.py:1723 ms2.7%
ReverseOneToOneDescriptor.fetch_onedjango/db/models/fields/related_descriptors.py:56223 ms2.7%
QuerySet.getdjango/db/models/query.py:70223 ms2.7%
QuerySet.__len__django/db/models/query.py:42123 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:226223 ms2.7%
ModelIterable.__iter__django/db/models/query.py:10323 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162523 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:7923 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9223 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:10523 ms2.7%
Cursor.executepsycopg/cursor.py:11323 ms2.7%
Connection.waitpsycopg/connection.py:49523 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:20623 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28622 ms2.6%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7822 ms2.6%
1 smaller frames hidden
BlockNode.renderdjango/template/loader_tags.py:6621 ms2.5%
NodeList.renderdjango/template/base.py:110821 ms2.5%
Node.render_annotateddjango/template/base.py:106921 ms2.5%
IfNode.renderdjango/template/defaulttags.py:33215 ms1.7%
QuerySet.__bool__django/db/models/query.py:45315 ms1.7%
QuerySet._fetch_alldjango/db/models/query.py:226411 ms1.4%
QuerySet._prefetch_related_objectsdjango/db/models/query.py:149011 ms1.4%
prefetch_related_objectsdjango/db/models/query.py:272410 ms1.2%
prefetch_one_leveldjango/db/models/query.py:28808 ms1.0%
create_reverse_many_to_one_manager.<locals>.RelatedManager.get_prefetch_querysetsdjango/db/models/fields/related_descriptors.py:8386 ms0.7%
QuerySet.__iter__django/db/models/query.py:4396 ms0.7%
QuerySet._fetch_alldjango/db/models/query.py:22626 ms0.7%
ModelIterable.__iter__django/db/models/query.py:1036 ms0.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16256 ms0.7%
CursorWrapper.executedjango/db/backends/utils.py:796 ms0.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:926 ms0.7%
CursorWrapper._executedjango/db/backends/utils.py:1056 ms0.7%
Cursor.executepsycopg/cursor.py:1136 ms0.7%
Connection.waitpsycopg/connection.py:4956 ms0.7%
2 smaller frames hidden
2 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
2 smaller frames hidden
1 smaller frames hidden
ClientHandler.__call__django/test/client.py:17310 ms1.2%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6310 ms1.2%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10410 ms1.2%
WhiteNoise.add_fileswhitenoise/base.py:10810 ms1.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1206 ms0.7%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1316 ms0.7%
WhiteNoise.get_static_filewhitenoise/base.py:2175 ms0.6%
1 smaller frames hidden
1 smaller frames hidden
teardown0.21 ms0.0%
Estimated from 805 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
fedidevs/tests.py:70
self.client.login(username="alice", password="pw")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Password hashing
|
393 ms |
|
fedidevs/tests.py:69
User.objects.create_user("alice", password="pw")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Password hashing
|
383 ms |
|
confs/views.py:128
return render(
conferences
· Database
|
48 ms |
|
fedidevs/tests.py:71
response = self.client.get("/conferences/")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header
· Libraries
|
10 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
31 queries · 25 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:70
|
834 ms |
| teardown pytest internals | 0.21 ms |
Reliability
14 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 14 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 835 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 1.36 s | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 1.32 s | Profile |
| 3 weeks ago | CI github-actions:test | passed | 650 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 1.15 s | Profile |
| 1 month ago | CI github-actions:test | passed | 1.19 s | Profile |
| 1 month ago | CI github-actions:test | passed | 720 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 1.34 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.02 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 869 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 2.00 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 2.12 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 2.02 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.17 s | Run |