flakytest.dev anze3db fedidevs
Tests / confs/tests.py

TestEditConference::test_other_user_forbidden_on_approved_conference

First seen 3 weeks ago in 0c23747
CI github-actions:test 11 runs
Average
1.84 s
median 1.62 s
max 3.19 s
Phases
Setup 3 ms Call 1.84 s Teardown 0.38 ms
Categories
Password hashing 1.72 s Database 40 ms Factories 0.69 ms Other (Libraries, pytest, Unsampled, Cache, ...) 82 ms

31 database queries per run

Needs 20 KB of memory (max 120 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 7 hours ago · open run
Show pytest frames
setup1 ms0.1%
call1.62 s99.9%
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")600 ms37.1%
UserManager.create_userdjango/contrib/auth/models.py:180600 ms37.1%
UserManager._create_userdjango/contrib/auth/models.py:167599 ms37.0%
UserManager._create_user_objectdjango/contrib/auth/models.py:160599 ms37.0%
make_passworddjango/contrib/auth/hashers.py:118599 ms37.0%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333599 ms37.0%
pbkdf2django/utils/crypto.py:93599 ms37.0%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)519 ms32.1%
UserManager.create_userdjango/contrib/auth/models.py:180519 ms32.1%
UserManager._create_userdjango/contrib/auth/models.py:167516 ms31.9%
UserManager._create_user_objectdjango/contrib/auth/models.py:160516 ms31.9%
make_passworddjango/contrib/auth/hashers.py:118516 ms31.9%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333516 ms31.9%
pbkdf2django/utils/crypto.py:93516 ms31.9%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")399 ms24.7%
UserManager.create_userdjango/contrib/auth/models.py:180399 ms24.7%
UserManager._create_userdjango/contrib/auth/models.py:167397 ms24.5%
UserManager._create_user_objectdjango/contrib/auth/models.py:160397 ms24.5%
make_passworddjango/contrib/auth/hashers.py:118397 ms24.5%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333397 ms24.5%
pbkdf2django/utils/crypto.py:93397 ms24.5%
1 smaller frames hidden
TestEditConference.test_other_user_forbidden_on_approved_conferenceconfs/tests.py:1280 self.assertEqual(self.client.get(self.url).status_code, 403)66 ms4.1%
Client.getdjango/test/client.py:113366 ms4.1%
RequestFactory.getdjango/test/client.py:47566 ms4.1%
RequestFactory.genericdjango/test/client.py:67166 ms4.1%
Client.requestdjango/test/client.py:109166 ms4.1%
ClientHandler.__call__django/test/client.py:18651 ms3.2%
BaseHandler.get_responsedjango/core/handlers/base.py:14251 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12351 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14551 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:38051 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5651 ms3.2%
BaseHandler._get_responsedjango/core/handlers/base.py:19951 ms3.2%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:5950 ms3.1%
login_required.<locals>.<lambda>django/contrib/auth/decorators.py:8250 ms3.1%
new_method_proxy.<locals>.innerdjango/utils/functional.py:25150 ms3.1%
SimpleLazyObject._setupdjango/utils/functional.py:40450 ms3.1%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:3950 ms3.1%
get_userdjango/contrib/auth/middleware.py:1950 ms3.1%
get_userdjango/contrib/auth/__init__.py:28727 ms1.7%
_get_user_session_keydjango/contrib/auth/__init__.py:11127 ms1.7%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:5527 ms1.7%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:25427 ms1.7%
SessionStore.loaddjango/contrib/sessions/backends/db.py:5527 ms1.6%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:3427 ms1.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:8727 ms1.6%
QuerySet.getdjango/db/models/query.py:70225 ms1.5%
QuerySet.__len__django/db/models/query.py:42125 ms1.5%
QuerySet._fetch_alldjango/db/models/query.py:226225 ms1.5%
ModelIterable.__iter__django/db/models/query.py:10324 ms1.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162523 ms1.4%
CursorWrapper.executedjango/db/backends/utils.py:7923 ms1.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9223 ms1.4%
CursorWrapper._executedjango/db/backends/utils.py:10523 ms1.4%
Cursor.executepsycopg/cursor.py:11323 ms1.4%
Connection.waitpsycopg/connection.py:49523 ms1.4%
BaseCursor._execute_genpsycopg/_cursor_base.py:20623 ms1.4%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28623 ms1.4%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7823 ms1.4%
1 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
get_userdjango/contrib/auth/__init__.py:29423 ms1.4%
ModelBackend.get_userdjango/contrib/auth/backends.py:23723 ms1.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:8723 ms1.4%
QuerySet.getdjango/db/models/query.py:70223 ms1.4%
QuerySet.__len__django/db/models/query.py:42123 ms1.4%
QuerySet._fetch_alldjango/db/models/query.py:226223 ms1.4%
ModelIterable.__iter__django/db/models/query.py:10322 ms1.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162522 ms1.3%
CursorWrapper.executedjango/db/backends/utils.py:7922 ms1.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9222 ms1.3%
CursorWrapper._executedjango/db/backends/utils.py:10522 ms1.3%
Cursor.executepsycopg/cursor.py:11322 ms1.3%
Connection.waitpsycopg/connection.py:49522 ms1.3%
1 smaller frames hidden
1 smaller frames hidden
ClientHandler.__call__django/test/client.py:17315 ms0.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6315 ms0.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10415 ms0.9%
WhiteNoise.add_fileswhitenoise/base.py:10814 ms0.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1209 ms0.5%
1 smaller frames hidden
TestEditConference.test_other_user_forbidden_on_approved_conferenceconfs/tests.py:1279 self.client.force_login(self.other)16 ms1.0%
ClientMixin.force_logindjango/test/client.py:85816 ms1.0%
TestEditConference.test_other_user_forbidden_on_approved_conferenceconfs/tests.py:1281 self.assertEqual(self.client.post(self.url, self._post_data()).status_code, 403)11 ms0.7%
Client.postdjango/test/client.py:116211 ms0.7%
RequestFactory.postdjango/test/client.py:49911 ms0.7%
RequestFactory.genericdjango/test/client.py:67111 ms0.7%
Client.requestdjango/test/client.py:109111 ms0.7%
ClientHandler.__call__django/test/client.py:18610 ms0.6%
BaseHandler.get_responsedjango/core/handlers/base.py:14210 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12310 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14510 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:38010 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5610 ms0.6%
BaseHandler._get_responsedjango/core/handlers/base.py:19910 ms0.6%
1 smaller frames hidden
2 smaller frames hidden
teardown0.67 ms0.0%
Estimated from 1,647 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
600 ms
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp · Password hashing
519 ms
confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp · Password hashing
399 ms
confs/tests.py:1280
self.assertEqual(self.client.get(self.url).status_code, 403)
TestEditConference.test_other_user_forbidden_on_approved_conference · Database
65 ms
confs/tests.py:1279
self.client.force_login(self.other)
TestEditConference.test_other_user_forbidden_on_approved_conference · Database
16 ms
confs/views.py:536
conference = get_object_or_404(Conference, slug=conference_slug)
edit_conference · Database
8 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
4 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
_template_string_if_invalid_marker function 0.06 ms
_dj_autoclear_mailbox function 0.06 ms
_django_db_marker function 0.05 ms
_django_isolate_apps function 0.05 ms
_django_set_urlconf function 0.05 ms
_live_server_helper function 0.05 ms
_django_clear_site_cache function 0.03 ms
monkeypatch function 0.03 ms

Database

31 queries · 45 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
1.52 s
call test body
confs/tests.py:1280
94 ms
call _post_teardown
django/test/testcases.py:1243
3 ms
setup pytest internals 1 ms
teardown pytest internals 0.67 ms

Reliability

12 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 12 results, oldest first in the strip
When Environment Outcome Duration Commit
7 hours ago CI github-actions:test passed 1.62 s c28a326 main Profile
16 hours ago CI github-actions:test passed 980 ms 9b8826a main Profile
22 hours ago CI github-actions:test passed 1.85 s 4f01055 main Profile
1 week, 5 days ago CI github-actions:test passed 1.73 s 8ab642e main Profile
2 weeks, 2 days ago CI github-actions:test passed 1.45 s 9b75244 main Profile
2 weeks, 2 days ago CI github-actions:test passed 1.55 s 9603516 main Profile
2 weeks, 4 days ago CI github-actions:test passed 1.46 s 615a272 main Profile
2 weeks, 6 days ago CI github-actions:test passed 878 ms d923a46 main Profile
3 weeks ago CI github-actions:test passed 3.19 s 82997f8 main Profile
3 weeks ago CI github-actions:test passed 3.18 s 623aa3e main Profile
3 weeks ago CI github-actions:test passed 2.42 s ab6465a main Profile
3 weeks ago CI github-actions:test passed 1.38 s 0c23747 main Run