Tests / confs/tests.py
TestCreateConference::test_slug_collision_is_resolved
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
687 ms
median 593 ms
max 1.34 s
max 1.34 s
Phases
Setup 6 ms
Call 680 ms
Teardown 0.38 ms
Categories
Password hashing 551 ms
Database 46 ms
Factories 0.72 ms
Test code 0.25 ms
Other (Libraries, pytest, Deep copies, Unsampled, ...) 89 ms
29 database queries per run
Needs 26 KB of memory (max 132 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call481 ms99.6%
TestCreateConference.setUpconfs/tests.py:1044 self.user = User.objects.create_user("alice", password="pw")410 ms85.0%
UserManager.create_userdjango/contrib/auth/models.py:180410 ms85.0%
UserManager._create_userdjango/contrib/auth/models.py:167409 ms84.8%
UserManager._create_user_objectdjango/contrib/auth/models.py:160409 ms84.8%
make_passworddjango/contrib/auth/hashers.py:118409 ms84.8%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333409 ms84.8%
pbkdf2django/utils/crypto.py:93409 ms84.8%
1 smaller frames hidden
TestCreateConference.test_slug_collision_is_resolvedconfs/tests.py:1111 self.client.post(reverse("create_conference"), self.form_data)50 ms10.4%
Client.postdjango/test/client.py:116250 ms10.4%
RequestFactory.postdjango/test/client.py:49950 ms10.4%
RequestFactory.genericdjango/test/client.py:67150 ms10.4%
Client.requestdjango/test/client.py:109150 ms10.4%
ClientHandler.__call__django/test/client.py:17342 ms8.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6342 ms8.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10442 ms8.6%
WhiteNoise.add_fileswhitenoise/base.py:10842 ms8.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12036 ms7.5%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13136 ms7.5%
WhiteNoise.get_static_filewhitenoise/base.py:21734 ms7.1%
StaticFile.__init__whitenoise/responders.py:7734 ms7.1%
StaticFile.get_alternativeswhitenoise/responders.py:20134 ms7.1%
Headers.__setitem__<stdlib>/wsgiref/headers.py:6434 ms7.1%
2 smaller frames hidden
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms0.9%
scantreewhitenoise/base.py:2713 ms0.6%
scantreewhitenoise/base.py:2713 ms0.6%
ClientHandler.__call__django/test/client.py:1868 ms1.7%
BaseHandler.get_responsedjango/core/handlers/base.py:1428 ms1.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms1.7%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms1.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms1.7%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms1.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms1.7%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms1.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms1.7%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1238 ms1.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms1.7%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1457 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms1.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms1.5%
BaseHandler._get_responsedjango/core/handlers/base.py:1997 ms1.5%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:626 ms1.3%
1 smaller frames hidden
1 smaller frames hidden
TestCreateConference.test_slug_collision_is_resolvedconfs/tests.py:1106 self.client.force_login(self.user)11 ms2.4%
ClientMixin.force_logindjango/test/client.py:85811 ms2.4%
ClientMixin._logindjango/test/client.py:8896 ms1.3%
logindjango/contrib/auth/__init__.py:1894 ms0.9%
2 smaller frames hidden
ClientMixin._logindjango/test/client.py:8843 ms0.6%
ClientMixin.sessiondjango/test/client.py:8153 ms0.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1213 ms0.6%
1 smaller frames hidden
TestCreateConference.test_slug_collision_is_resolvedconfs/tests.py:11094 ms0.9%
TestCase.captureOnCommitCallbacksdjango/test/testcases.py:15364 ms0.9%
create_conference.<locals>.<lambda>confs/views.py:5034 ms0.9%
send_approval_notificationconfs/views.py:606 send_mail(4 ms0.9%
CallableMixin.__call__<stdlib>/unittest/mock.py:11764 ms0.9%
CallableMixin._mock_call<stdlib>/unittest/mock.py:11804 ms0.9%
CallableMixin._execute_mock_call<stdlib>/unittest/mock.py:12614 ms0.9%
NonCallableMock.__get_return_value<stdlib>/unittest/mock.py:5844 ms0.9%
NonCallableMock._get_child_mock<stdlib>/unittest/mock.py:10974 ms0.9%
MagicMixin.__init__<stdlib>/unittest/mock.py:21864 ms0.9%
MagicMixin._mock_set_magics<stdlib>/unittest/mock.py:22094 ms0.9%
__init____init__:-14 ms0.9%
MagicProxy.__init__<stdlib>/unittest/mock.py:22634 ms0.9%
<GC>~4 ms0.9%
3 smaller frames hidden
teardown1 ms0.2%
Estimated from 463 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
confs/tests.py:1044
self.user = User.objects.create_user("alice", password="pw")
TestCreateConference.setUp
· Password hashing
|
410 ms |
|
confs/tests.py:1111
self.client.post(reverse("create_conference"), self.form_data)
TestCreateConference.test_slug_collision_is_resolved
· Libraries
|
44 ms |
|
confs/tests.py:1106
self.client.force_login(self.user)
TestCreateConference.test_slug_collision_is_resolved
· Database
|
11 ms |
|
confs/views.py:606
send_mail(
send_approval_notification
· Mocking
|
4 ms |
|
confs/tests.py:1105
baker.make(Conference, slug="pycon-test")
TestCreateConference.test_slug_collision_is_resolved
· Database
|
2 ms |
|
confs/views.py:475
while Conference.objects.filter(slug=slug).exists():
unique_conference_slug
· Database
|
2 ms |
|
confs/views.py:497
conference.save()
create_conference
· Database
|
2 ms |
|
confs/tests.py:1108
mock.patch("confs.views.send_mail"),
TestCreateConference.test_slug_collision_is_resolved
· Test code
|
1 ms |
|
confs/views.py:420
super().__init__(*args, **kwargs)
ConferenceForm.__init__
· Deep copies
|
1 ms |
|
confs/views.py:498
form.save_m2m() # persist the selected conference_tags (icons)
create_conference
· Database
|
1 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.04 ms |
| _django_isolate_apps function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_db_marker function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_set_urlconf function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
29 queries · 17 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
SELECT %s AS "a" FROM "confs_conference" WHERE "confs_conference"."slug" = %s LIMIT ?
Biggest pieces of work
|
call setUp
confs/tests.py:1044
|
410 ms |
|
call test body
confs/tests.py:1111
|
69 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
2 ms |
| teardown pytest internals | 1 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 | 483 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 655 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 603 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 331 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 585 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 694 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 490 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 564 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 593 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 457 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.34 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.04 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.09 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 811 ms | Run |