Tests / confs/tests.py
TestEditConference::test_other_user_forbidden_on_approved_conference
First seen 13 hours ago in 0c23747
CI
github-actions:test
4 runs
Average
2.42 s
median 2.80 s
max 3.19 s
max 3.19 s
Phases
Setup 2 ms
Call 2.41 s
Teardown 0.35 ms
Categories
Password hashing 2.26 s
Database 36 ms
Factories 0.65 ms
Other (Libraries, Unsampled, Cache, pytest) 120 ms
31 database queries per run
Needs 9 KB of memory (max 16 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 7 hours ago ·
open run
call877 ms99.9%
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")284 ms32.4%
UserManager.create_userdjango/contrib/auth/models.py:180284 ms32.4%
UserManager._create_userdjango/contrib/auth/models.py:167283 ms32.3%
UserManager._create_user_objectdjango/contrib/auth/models.py:159283 ms32.3%
make_passworddjango/contrib/auth/hashers.py:118282 ms32.2%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333282 ms32.2%
pbkdf2django/utils/crypto.py:93282 ms32.2%
1 smaller frames hidden
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)268 ms30.5%
UserManager.create_userdjango/contrib/auth/models.py:180268 ms30.5%
UserManager._create_userdjango/contrib/auth/models.py:167267 ms30.4%
UserManager._create_user_objectdjango/contrib/auth/models.py:160267 ms30.4%
make_passworddjango/contrib/auth/hashers.py:118267 ms30.4%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333267 ms30.4%
pbkdf2django/utils/crypto.py:93267 ms30.4%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")254 ms29.0%
UserManager.create_userdjango/contrib/auth/models.py:180254 ms29.0%
UserManager._create_userdjango/contrib/auth/models.py:167254 ms29.0%
UserManager._create_user_objectdjango/contrib/auth/models.py:160254 ms29.0%
make_passworddjango/contrib/auth/hashers.py:118254 ms29.0%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333254 ms29.0%
pbkdf2django/utils/crypto.py:93254 ms29.0%
TestEditConference.test_other_user_forbidden_on_approved_conferenceconfs/tests.py:1280 self.assertEqual(self.client.get(self.url).status_code, 403)51 ms5.8%
Client.getdjango/test/client.py:113351 ms5.8%
RequestFactory.getdjango/test/client.py:47551 ms5.8%
RequestFactory.genericdjango/test/client.py:67151 ms5.8%
Client.requestdjango/test/client.py:109151 ms5.8%
ClientHandler.__call__django/test/client.py:17345 ms5.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6345 ms5.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10443 ms4.8%
WhiteNoise.add_fileswhitenoise/base.py:10843 ms4.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12039 ms4.5%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13138 ms4.4%
WhiteNoise.get_static_filewhitenoise/base.py:21730 ms3.4%
StaticFile.__init__whitenoise/responders.py:7211 ms1.3%
StaticFile.get_file_statswhitenoise/responders.py:16111 ms1.3%
__init____init__:-19 ms1.1%
FileEntry.__init__whitenoise/responders.py:2639 ms1.1%
FileEntry.stat_regular_filewhitenoise/responders.py:2768 ms0.9%
<GC>~8 ms0.9%
StaticFile.__init__whitenoise/responders.py:767 ms0.8%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1887 ms0.8%
Headers.__contains__<stdlib>/wsgiref/headers.py:877 ms0.8%
StaticFile.__init__whitenoise/responders.py:776 ms0.7%
2 smaller frames hidden
WhiteNoise.get_static_filewhitenoise/base.py:2126 ms0.7%
WhiteNoise.add_cache_headerswhitenoise/base.py:2335 ms0.6%
1 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
2 smaller frames hidden
ClientHandler.__call__django/test/client.py:1865 ms0.6%
BaseHandler.get_responsedjango/core/handlers/base.py:1425 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1235 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1455 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
1 smaller frames hidden
TestEditConference.test_other_user_forbidden_on_approved_conferenceconfs/tests.py:1279 self.client.force_login(self.other)8 ms0.9%
ClientMixin.force_logindjango/test/client.py:8588 ms0.9%
ClientMixin._logindjango/test/client.py:8895 ms0.6%
2 smaller frames hidden
TestEditConference.test_other_user_forbidden_on_approved_conferenceconfs/tests.py:1281 self.assertEqual(self.client.post(self.url, self._post_data()).status_code, 403)5 ms0.6%
Client.postdjango/test/client.py:11625 ms0.6%
RequestFactory.postdjango/test/client.py:4995 ms0.6%
RequestFactory.genericdjango/test/client.py:6715 ms0.6%
Client.requestdjango/test/client.py:10915 ms0.6%
ClientHandler.__call__django/test/client.py:1865 ms0.6%
BaseHandler.get_responsedjango/core/handlers/base.py:1425 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1235 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1455 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
3 smaller frames hidden
Estimated from 845 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
confs/tests.py:1175
self.owner = User.objects.create_user("owner", password="pw")
TestEditConference.setUp
· Password hashing
|
284 ms |
|
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp
· Password hashing
|
268 ms |
|
confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp
· Password hashing
|
254 ms |
|
confs/tests.py:1280
self.assertEqual(self.client.get(self.url).status_code, 403)
TestEditConference.test_other_user_forbidden_on_approved_conference
· Libraries
|
48 ms |
|
confs/tests.py:1279
self.client.force_login(self.other)
TestEditConference.test_other_user_forbidden_on_approved_conference
· Database
|
8 ms |
|
confs/views.py:536
conference = get_object_or_404(Conference, slug=conference_slug)
edit_conference
· Database
|
5 ms |
|
confs/tests.py:1281
self.assertEqual(self.client.post(self.url, self._post_data()).status_code, 403)
TestEditConference.test_other_user_forbidden_on_approved_conference
· Database
|
3 ms |
|
confs/tests.py:1178
self.conference = baker.make(
TestEditConference.setUp
· Database
|
2 ms |
|
confs/tests.py:1277
self.conference.save(update_fields=["approved_at"])
TestEditConference.test_other_user_forbidden_on_approved_conference
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_db_marker function | 0.03 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.02 ms |
| monkeypatch function | 0.02 ms |
Database
31 queries · 12 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
INSERT INTO "auth_user" ("password", "last_login", "is_superuser", "username", "first_name", "last_name", "email", "is_staff", "is_active", "date_joined") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "auth_user"."id"
3×
SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > %s AND "django_session"."session_key" = %s) LIMIT ?
Biggest pieces of work
|
call setUp
confs/tests.py:1175
|
809 ms |
|
call test body
confs/tests.py:1280
|
66 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
2 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 | 878 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 3.19 s | Profile |
| 7 hours ago | CI github-actions:test | passed | 3.18 s | Profile |
| 12 hours ago | CI github-actions:test | passed | 2.42 s | Profile |
| 13 hours ago | CI github-actions:test | passed | 1.38 s | Run |