Tests / confs/tests.py
TestEditConference::test_staff_can_edit
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
1.07 s
median 946 ms
max 2.19 s
max 2.19 s
Phases
Setup 1 ms
Call 1.07 s
Teardown 2 ms
Categories
Password hashing 1.02 s
Database 19 ms
Factories 0.53 ms
Test code 0.08 ms
Other (Libraries, Deep copies, pytest, Unsampled, ...) 37 ms
31 database queries per run
Needs 292 KB of memory (max 1012 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call749 ms99.8%
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")250 ms33.3%
UserManager.create_userdjango/contrib/auth/models.py:180250 ms33.3%
UserManager._create_userdjango/contrib/auth/models.py:167249 ms33.2%
UserManager._create_user_objectdjango/contrib/auth/models.py:160249 ms33.2%
make_passworddjango/contrib/auth/hashers.py:118249 ms33.2%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333249 ms33.2%
pbkdf2django/utils/crypto.py:93249 ms33.2%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)238 ms31.7%
UserManager.create_userdjango/contrib/auth/models.py:180238 ms31.7%
UserManager._create_userdjango/contrib/auth/models.py:167237 ms31.6%
UserManager._create_user_objectdjango/contrib/auth/models.py:160237 ms31.6%
make_passworddjango/contrib/auth/hashers.py:118237 ms31.6%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333237 ms31.6%
pbkdf2django/utils/crypto.py:93237 ms31.6%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")235 ms31.3%
UserManager.create_userdjango/contrib/auth/models.py:180235 ms31.3%
UserManager._create_userdjango/contrib/auth/models.py:167234 ms31.2%
UserManager._create_user_objectdjango/contrib/auth/models.py:160234 ms31.2%
make_passworddjango/contrib/auth/hashers.py:118234 ms31.2%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333234 ms31.2%
pbkdf2django/utils/crypto.py:93234 ms31.2%
1 smaller frames hidden
TestEditConference.test_staff_can_editconfs/tests.py:1230 self.client.post(self.url, self._post_data(name="Staff Edit"))18 ms2.4%
Client.postdjango/test/client.py:116218 ms2.4%
RequestFactory.postdjango/test/client.py:49918 ms2.4%
RequestFactory.genericdjango/test/client.py:67118 ms2.4%
Client.requestdjango/test/client.py:109118 ms2.4%
ClientHandler.__call__django/test/client.py:17313 ms1.8%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6313 ms1.8%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10413 ms1.8%
WhiteNoise.add_fileswhitenoise/base.py:10813 ms1.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1208 ms1.1%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1317 ms0.9%
WhiteNoise.get_static_filewhitenoise/base.py:2177 ms0.9%
StaticFile.__init__whitenoise/responders.py:734 ms0.5%
1 smaller frames hidden
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms0.5%
ClientHandler.__call__django/test/client.py:1865 ms0.7%
BaseHandler.get_responsedjango/core/handlers/base.py:1425 ms0.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.7%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.7%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1234 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1454 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.5%
BaseHandler._get_responsedjango/core/handlers/base.py:1994 ms0.5%
1 smaller frames hidden
TestEditConference.test_staff_can_editconfs/tests.py:1229 self.client.force_login(self.staff)6 ms0.8%
ClientMixin.force_logindjango/test/client.py:8586 ms0.8%
ClientMixin._logindjango/test/client.py:8894 ms0.5%
2 smaller frames hidden
2 smaller frames hidden
Estimated from 740 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
|
250 ms |
|
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp
· Password hashing
|
238 ms |
|
confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp
· Password hashing
|
235 ms |
|
confs/tests.py:1230
self.client.post(self.url, self._post_data(name="Staff Edit"))
TestEditConference.test_staff_can_edit
· Libraries
|
15 ms |
|
confs/tests.py:1229
self.client.force_login(self.staff)
TestEditConference.test_staff_can_edit
· Database
|
6 ms |
|
confs/tests.py:1178
self.conference = baker.make(
TestEditConference.setUp
· Database
|
1 ms |
|
confs/views.py:536
conference = get_object_or_404(Conference, slug=conference_slug)
edit_conference
· Database
|
1 ms |
|
confs/views.py:420
super().__init__(*args, **kwargs)
ConferenceForm.__init__
· Database
|
1 ms |
|
confs/views.py:543
form.save()
edit_conference
· Database
|
1 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.02 ms |
| _django_isolate_apps function | 0.02 ms |
| _live_server_helper function | 0.02 ms |
| _django_set_urlconf function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.01 ms |
Database
31 queries · 8 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"
Biggest pieces of work
|
call setUp
confs/tests.py:1175
|
724 ms |
|
call test body
confs/tests.py:1229
|
24 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
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 | 750 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 952 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 922 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 629 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 946 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 934 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 1.35 s | Profile |
| 1 month ago | CI github-actions:test | passed | 918 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.03 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 744 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 1.64 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 961 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 2.19 s | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 917 ms | Run |