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

TestEditConference::test_other_user_forbidden_on_approved_conference

First seen 1 month, 1 week ago in 0c23747
CI github-actions:test 13 runs
Average
1.79 s
median 1.62 s
max 3.19 s
Phases
Setup 3 ms Call 1.79 s Teardown 0.37 ms
Categories
Password hashing 1.67 s Database 39 ms Factories 0.74 ms Other (Libraries, pytest, Unsampled, Cache, ...) 82 ms

31 database queries per run

Needs 17 KB of memory (max 120 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
setup2 ms0.2%
call1.19 s99.8%
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")430 ms36.0%
UserManager.create_userdjango/contrib/auth/models.py:180430 ms36.0%
UserManager._create_userdjango/contrib/auth/models.py:167429 ms35.9%
UserManager._create_user_objectdjango/contrib/auth/models.py:160429 ms35.9%
make_passworddjango/contrib/auth/hashers.py:118429 ms35.9%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333429 ms35.9%
pbkdf2django/utils/crypto.py:93429 ms35.9%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")379 ms31.7%
UserManager.create_userdjango/contrib/auth/models.py:180379 ms31.7%
UserManager._create_userdjango/contrib/auth/models.py:167379 ms31.7%
UserManager._create_user_objectdjango/contrib/auth/models.py:160379 ms31.7%
make_passworddjango/contrib/auth/hashers.py:118379 ms31.7%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333379 ms31.7%
pbkdf2django/utils/crypto.py:93379 ms31.7%
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)341 ms28.5%
UserManager.create_userdjango/contrib/auth/models.py:180341 ms28.5%
UserManager._create_userdjango/contrib/auth/models.py:167340 ms28.4%
UserManager._create_user_objectdjango/contrib/auth/models.py:160340 ms28.4%
make_passworddjango/contrib/auth/hashers.py:118338 ms28.3%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333338 ms28.3%
pbkdf2django/utils/crypto.py:93338 ms28.3%
1 smaller frames hidden
1 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)24 ms2.0%
Client.postdjango/test/client.py:116224 ms2.0%
RequestFactory.postdjango/test/client.py:49924 ms2.0%
RequestFactory.genericdjango/test/client.py:67124 ms2.0%
Client.requestdjango/test/client.py:109124 ms2.0%
ClientHandler.__call__django/test/client.py:18624 ms2.0%
BaseHandler.get_responsedjango/core/handlers/base.py:14222 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12322 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14522 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38022 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5622 ms1.9%
BaseHandler._get_responsedjango/core/handlers/base.py:19922 ms1.9%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:6222 ms1.9%
edit_conferenceconfs/views.py:536 conference = get_object_or_404(Conference, slug=conference_slug)22 ms1.9%
get_object_or_404django/shortcuts.py:10022 ms1.9%
QuerySet.getdjango/db/models/query.py:70222 ms1.9%
QuerySet.__len__django/db/models/query.py:42122 ms1.9%
QuerySet._fetch_alldjango/db/models/query.py:226222 ms1.9%
ModelIterable.__iter__django/db/models/query.py:10320 ms1.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162520 ms1.7%
CursorWrapper.executedjango/db/backends/utils.py:7920 ms1.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9220 ms1.7%
CursorWrapper._executedjango/db/backends/utils.py:10519 ms1.6%
Cursor.executepsycopg/cursor.py:11319 ms1.6%
Connection.waitpsycopg/connection.py:49519 ms1.6%
BaseCursor._execute_genpsycopg/_cursor_base.py:20619 ms1.6%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28619 ms1.6%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7819 ms1.6%
1 smaller frames hidden
1 smaller frames hidden
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()6 ms0.5%
TestCase._fixture_teardowndjango/test/testcases.py:14976 ms0.5%
TestCase._should_check_constraintsdjango/test/testcases.py:15066 ms0.5%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:5046 ms0.5%
Cursor.executepsycopg/cursor.py:1136 ms0.5%
Connection.waitpsycopg/connection.py:4956 ms0.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2066 ms0.5%
4 smaller frames hidden
Estimated from 1,174 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
430 ms
confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp · Password hashing
379 ms
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp · Password hashing
341 ms
confs/views.py:536
conference = get_object_or_404(Conference, slug=conference_slug)
edit_conference · Database
22 ms
confs/tests.py:1279
self.client.force_login(self.other)
TestEditConference.test_other_user_forbidden_on_approved_conference · Database
5 ms
confs/tests.py:1280
self.assertEqual(self.client.get(self.url).status_code, 403)
TestEditConference.test_other_user_forbidden_on_approved_conference · Libraries
4 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 · Libraries
2 ms
confs/tests.py:1178
self.conference = baker.make(
TestEditConference.setUp · Factories
1 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.04 ms
_django_set_urlconf function 0.03 ms
_django_isolate_apps function 0.03 ms
_live_server_helper function 0.03 ms
_django_clear_site_cache function 0.03 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
1.15 s
call test body
confs/tests.py:1281
34 ms
call _post_teardown
django/test/testcases.py:1243
6 ms
setup pytest internals 2 ms
call _pre_setup
django/test/testcases.py:1167
2 ms

Reliability

14 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

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