flakytest.dev anze3db flakytest
Tests / apps/orgs/tests.py

MembersTest::test_invitations_expire

First seen 8 hours ago in 78a4357
CI github-actions:test 5 runs
Average
76 ms
median 83 ms
max 88 ms
Phases
Setup 18 ms Call 58 ms Teardown 0.16 ms
Categories
Database 42 ms App code 0.40 ms Test code 0.28 ms Other (Libraries, Templates, pytest, Unsampled) 33 ms

41 database queries per run

Needs 244 KB of memory (max 592 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, an hour ago · open run
Show pytest frames
setup21 ms23.9%
TestCase.setUpClassdjango/test/testcases.py:1423 cls.cls_atomics = cls._enter_atomics()15 ms17.6%
TestCase._enter_atomicsdjango/test/testcases.py:139615 ms17.6%
Atomic.__enter__django/db/transaction.py:19815 ms17.6%
BaseDatabaseWrapper.get_autocommitdjango/db/backends/base/base.py:45415 ms17.6%
SimpleTestCase.ensure_connection_patch_method.<locals>.patched_ensure_connectiondjango/test/testcases.py:30315 ms17.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2615 ms17.6%
BaseDatabaseWrapper.ensure_connectiondjango/db/backends/base/base.py:27915 ms17.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2615 ms17.6%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:25614 ms16.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2614 ms16.3%
DatabaseWrapper.get_new_connectiondjango/db/backends/postgresql/base.py:33314 ms16.3%
Connection.connectpsycopg/connection.py:10912 ms13.8%
wait_connpsycopg/waiting.py:1416 ms6.3%
EpollSelector.select<stdlib>/selectors.py:4526 ms6.3%
wait_connpsycopg/waiting.py:1456 ms6.3%
BaseConnection._connect_genpsycopg/_connection_base.py:4396 ms6.3%
wait_connpsycopg/waiting.py:1361 ms1.3%
BaseConnection._connect_genpsycopg/_connection_base.py:4391 ms1.3%
Connection.connectpsycopg/connection.py:1002 ms2.5%
conninfo_attemptspsycopg/_conninfo_attempts.py:452 ms2.5%
_resolve_hostnamespsycopg/_conninfo_attempts.py:1022 ms2.5%
getaddrinfo<stdlib>/socket.py:9982 ms2.5%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:2581 ms1.3%
DatabaseWrapper.init_connection_statedjango/db/backends/postgresql/base.py:4021 ms1.3%
DatabaseWrapper._configure_connectiondjango/db/backends/postgresql/base.py:3741 ms1.3%
DatabaseWrapper._configure_timezonedjango/db/backends/postgresql/base.py:3571 ms1.3%
Cursor.executepsycopg/cursor.py:1131 ms1.3%
Connection.waitpsycopg/connection.py:4951 ms1.3%
TestCase.setUpClassdjango/test/testcases.py:1439 cls.setUpTestData()6 ms6.3%
OrganizationTestCase.setUpTestDataapps/orgs/tests.py:52 cls.owner = User.objects.create_user("owner", email="[email protected]")2 ms2.5%
UserManager.create_userdjango/contrib/auth/models.py:1752 ms2.5%
UserManager._create_userdjango/contrib/auth/models.py:1632 ms2.5%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms2.5%
Model.savedjango/db/models/base.py:8742 ms2.5%
Model.save_basedjango/db/models/base.py:9662 ms2.5%
Model._save_tabledjango/db/models/base.py:11672 ms2.5%
Model._do_insertdjango/db/models/base.py:12182 ms2.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.5%
QuerySet._insertdjango/db/models/query.py:19182 ms2.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
OrganizationTestCase.setUpTestDataapps/orgs/tests.py:55 cls.organization = Organization.objects.create(name="Acme", slug="acme")1 ms1.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms1.3%
QuerySet.createdjango/db/models/query.py:6691 ms1.3%
Model.savedjango/db/models/base.py:8741 ms1.3%
Model.save_basedjango/db/models/base.py:9661 ms1.3%
Model._save_tabledjango/db/models/base.py:11671 ms1.3%
Model._do_insertdjango/db/models/base.py:12181 ms1.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms1.3%
QuerySet._insertdjango/db/models/query.py:19181 ms1.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19251 ms1.3%
CursorWrapper.executedjango/db/backends/utils.py:791 ms1.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms1.3%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms1.3%
Cursor.executepsycopg/cursor.py:1131 ms1.3%
Connection.waitpsycopg/connection.py:4951 ms1.3%
OrganizationTestCase.setUpTestDataapps/orgs/tests.py:57 cls.membership = Membership.objects.create(organization=cls.organization, user=cls.member)1 ms1.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms1.3%
QuerySet.createdjango/db/models/query.py:6671 ms1.3%
Model.__init__django/db/models/base.py:4871 ms1.3%
OrganizationTestCase.setUpTestDataapps/orgs/tests.py:581 ms1.3%
make_projectapps/projects/testing.py:67 slug=unique_slug(name, organization.project_set.all(), fallback="project", reserved=RESERVED_PROJECT_SLUGS),1 ms1.3%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():1 ms1.3%
QuerySet.existsdjango/db/models/query.py:13371 ms1.3%
Query.has_resultsdjango/db/models/sql/query.py:6811 ms1.3%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15921 ms1.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms1.3%
CursorWrapper.executedjango/db/backends/utils.py:791 ms1.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms1.3%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms1.3%
Cursor.executepsycopg/cursor.py:1131 ms1.3%
Connection.waitpsycopg/connection.py:4951 ms1.3%
call67 ms75.9%
MembersTest.test_invitations_expireapps/orgs/tests.py:133 response = self.client.get(reverse("invitation", args=[invitation.token]))42 ms48.3%
Client.getdjango/test/client.py:112442 ms48.3%
RequestFactory.getdjango/test/client.py:47542 ms48.3%
RequestFactory.genericdjango/test/client.py:67142 ms48.3%
Client.requestdjango/test/client.py:108242 ms48.3%
ClientHandler.__call__django/test/client.py:17334 ms39.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6234 ms39.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10434 ms39.1%
WhiteNoise.add_fileswhitenoise/base.py:10834 ms39.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12028 ms32.2%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13128 ms32.2%
WhiteNoise.get_static_filewhitenoise/base.py:20822 ms25.3%
StaticFile.__init__whitenoise/responders.py:7710 ms11.5%
StaticFile.get_alternativeswhitenoise/responders.py:20010 ms11.5%
__init____init__:-16 ms6.9%
Headers.__init__<stdlib>/wsgiref/headers.py:366 ms6.9%
<GC>~6 ms6.9%
StaticFile.__init__whitenoise/responders.py:724 ms4.6%
StaticFile.get_file_statswhitenoise/responders.py:1614 ms4.6%
StaticFile.__init__whitenoise/responders.py:744 ms4.6%
parsedate<stdlib>/email/_parseaddr.py:1854 ms4.6%
StaticFile.__init__whitenoise/responders.py:764 ms4.6%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms2.3%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms2.3%
<GC>~2 ms2.3%
WhiteNoise.get_static_filewhitenoise/base.py:2036 ms6.9%
WhiteNoise.add_cache_headerswhitenoise/base.py:2244 ms4.6%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1764 ms4.6%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1974 ms4.6%
URLMixin.urldebug_toolbar/panels/staticfiles.py:204 ms4.6%
WhiteNoise.add_cache_headerswhitenoise/base.py:2272 ms2.3%
Headers.__setitem__<stdlib>/wsgiref/headers.py:622 ms2.3%
Headers.__delitem__<stdlib>/wsgiref/headers.py:712 ms2.3%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms2.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1156 ms6.9%
scantreewhitenoise/base.py:2626 ms6.9%
scantreewhitenoise/base.py:2626 ms6.9%
scantreewhitenoise/base.py:2644 ms4.6%
scantreewhitenoise/base.py:2622 ms2.3%
scantreewhitenoise/base.py:2622 ms2.3%
scantreewhitenoise/base.py:2622 ms2.3%
scantreewhitenoise/base.py:2642 ms2.3%
ClientHandler.__call__django/test/client.py:1868 ms9.2%
BaseHandler.get_responsedjango/core/handlers/base.py:1418 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1308 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1238 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:348 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
BaseHandler._get_responsedjango/core/handlers/base.py:1988 ms9.2%
invitationapps/orgs/views.py:247 invitation = get_object_or_404(Invitation.objects.select_related("organization", "invited_by"), token=token)4 ms4.6%
get_object_or_404django/shortcuts.py:904 ms4.6%
QuerySet.getdjango/db/models/query.py:6354 ms4.6%
QuerySet.__len__django/db/models/query.py:3724 ms4.6%
QuerySet._fetch_alldjango/db/models/query.py:20004 ms4.6%
ModelIterable.__iter__django/db/models/query.py:954 ms4.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms2.3%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7952 ms2.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms2.3%
WhereNode.as_sqldjango/db/models/sql/where.py:1512 ms2.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms2.3%
Exact.as_sqldjango/db/models/lookups.py:4072 ms2.3%
BuiltinLookup.as_sqldjango/db/models/lookups.py:2382 ms2.3%
BuiltinLookup.process_lhsdjango/db/models/lookups.py:2302 ms2.3%
Lookup.process_lhsdjango/db/models/lookups.py:1092 ms2.3%
BaseExpression.resolve_expressiondjango/db/models/expressions.py:2972 ms2.3%
BaseExpression.copydjango/db/models/expressions.py:4442 ms2.3%
copy<stdlib>/copy.py:1002 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
invitationapps/orgs/views.py:249 member = request.user.is_authenticated and organization.is_member(request.user)2 ms2.3%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2512 ms2.3%
SimpleLazyObject._setupdjango/utils/functional.py:4042 ms2.3%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:402 ms2.3%
get_userdjango/contrib/auth/middleware.py:202 ms2.3%
get_userdjango/contrib/auth/__init__.py:3112 ms2.3%
_get_user_session_keydjango/contrib/auth/__init__.py:952 ms2.3%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:552 ms2.3%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms2.3%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms2.3%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms2.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.3%
QuerySet.getdjango/db/models/query.py:6352 ms2.3%
QuerySet.__len__django/db/models/query.py:3722 ms2.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.3%
ModelIterable.__iter__django/db/models/query.py:952 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
invitationapps/orgs/views.py:260 return render(2 ms2.3%
MembersTest.test_invitations_expireapps/orgs/tests.py:132 self.client.force_login(self.stranger)8 ms9.2%
ClientMixin.force_logindjango/test/client.py:8558 ms9.2%
ClientMixin._logindjango/test/client.py:8764 ms4.6%
ClientMixin.sessiondjango/test/client.py:8124 ms4.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1214 ms4.6%
SessionStore.createdjango/contrib/sessions/backends/db.py:702 ms2.3%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1982 ms2.3%
SessionStore.existsdjango/contrib/sessions/backends/db.py:632 ms2.3%
QuerySet.existsdjango/db/models/query.py:13372 ms2.3%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms2.3%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms2.3%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms2.3%
Model.savedjango/db/models/base.py:8742 ms2.3%
Model.save_basedjango/db/models/base.py:9662 ms2.3%
Model._save_tabledjango/db/models/base.py:11672 ms2.3%
Model._do_insertdjango/db/models/base.py:12182 ms2.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.3%
QuerySet._insertdjango/db/models/query.py:19182 ms2.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.3%
ClientMixin._logindjango/test/client.py:8814 ms4.6%
logindjango/contrib/auth/__init__.py:1872 ms2.3%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4342 ms2.3%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms2.3%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms2.3%
Model.savedjango/db/models/base.py:8742 ms2.3%
Model.save_basedjango/db/models/base.py:9662 ms2.3%
Model._save_tabledjango/db/models/base.py:11672 ms2.3%
Model._do_insertdjango/db/models/base.py:12182 ms2.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.3%
QuerySet._insertdjango/db/models/query.py:19182 ms2.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
logindjango/contrib/auth/__init__.py:1972 ms2.3%
Signal.senddjango/dispatch/dispatcher.py:2092 ms2.3%
update_last_logindjango/contrib/auth/models.py:242 ms2.3%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms2.3%
Model.savedjango/db/models/base.py:8742 ms2.3%
Model.save_basedjango/db/models/base.py:9662 ms2.3%
Model._save_tabledjango/db/models/base.py:11102 ms2.3%
Model._do_updatedjango/db/models/base.py:12112 ms2.3%
QuerySet._updatedjango/db/models/query.py:13272 ms2.3%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms2.3%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
MembersTest.test_invitations_expireapps/orgs/tests.py:1358 ms9.2%
Client.postdjango/test/client.py:11538 ms9.2%
RequestFactory.postdjango/test/client.py:4998 ms9.2%
RequestFactory.genericdjango/test/client.py:6718 ms9.2%
Client.requestdjango/test/client.py:10828 ms9.2%
ClientHandler.__call__django/test/client.py:1868 ms9.2%
BaseHandler.get_responsedjango/core/handlers/base.py:1418 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1308 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1238 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:348 ms9.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms9.2%
BaseHandler._get_responsedjango/core/handlers/base.py:1988 ms9.2%
invitationapps/orgs/views.py:249 member = request.user.is_authenticated and organization.is_member(request.user)4 ms4.6%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2512 ms2.3%
SimpleLazyObject._setupdjango/utils/functional.py:4042 ms2.3%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:402 ms2.3%
get_userdjango/contrib/auth/middleware.py:202 ms2.3%
get_userdjango/contrib/auth/__init__.py:3182 ms2.3%
ModelBackend.get_userdjango/contrib/auth/backends.py:2322 ms2.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.3%
QuerySet.getdjango/db/models/query.py:6352 ms2.3%
QuerySet.__len__django/db/models/query.py:3722 ms2.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.3%
ModelIterable.__iter__django/db/models/query.py:952 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
Organization.is_memberapps/orgs/models.py:62 return user.is_authenticated and self.membership_set.filter(user=user).exists()2 ms2.3%
QuerySet.existsdjango/db/models/query.py:13372 ms2.3%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms2.3%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
invitationapps/orgs/views.py:247 invitation = get_object_or_404(Invitation.objects.select_related("organization", "invited_by"), token=token)2 ms2.3%
get_object_or_404django/shortcuts.py:902 ms2.3%
QuerySet.getdjango/db/models/query.py:6252 ms2.3%
QuerySet.filterdjango/db/models/query.py:15422 ms2.3%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms2.3%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms2.3%
Query.add_qdjango/db/models/sql/query.py:16712 ms2.3%
Query._add_qdjango/db/models/sql/query.py:17032 ms2.3%
Query.build_filterdjango/db/models/sql/query.py:16132 ms2.3%
Query.build_lookupdjango/db/models/sql/query.py:14402 ms2.3%
Lookup.__init__django/db/models/lookups.py:352 ms2.3%
invitationapps/orgs/views.py:2632 ms2.3%
org_shellapps/orgs/views.py:33 organizations = [] if user.is_anonymous else list(Organization.objects.filter(membership__user=user))2 ms2.3%
QuerySet.__iter__django/db/models/query.py:3902 ms2.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.3%
ModelIterable.__iter__django/db/models/query.py:952 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.3%
BaseCursor._convert_querypsycopg/_cursor_base.py:4652 ms2.3%
PostgresClientQuery.convertpsycopg/_queries.py:2892 ms2.3%
PostgresClientQuery.dumppsycopg/_queries.py:2992 ms2.3%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()4 ms4.6%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms2.3%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4832 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms2.3%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms2.3%
Atomic.__exit__django/db/transaction.py:2862 ms2.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.3%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms2.3%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
MembersTest.test_invitations_expireapps/orgs/tests.py:130 invitation = Invitation.objects.create(organization=self.organization, email="[email protected]")2 ms2.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.3%
QuerySet.createdjango/db/models/query.py:6692 ms2.3%
Model.savedjango/db/models/base.py:8742 ms2.3%
Model.save_basedjango/db/models/base.py:9662 ms2.3%
Model._save_tabledjango/db/models/base.py:11672 ms2.3%
Model._do_insertdjango/db/models/base.py:12182 ms2.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.3%
QuerySet._insertdjango/db/models/query.py:19182 ms2.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
MembersTest.test_invitations_expireapps/orgs/tests.py:131 Invitation.objects.filter(pk=invitation.pk).update(date_created=timezone.now() - dt.timedelta(days=15))2 ms2.3%
QuerySet.updatedjango/db/models/query.py:13002 ms2.3%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms2.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.3%
Cursor.executepsycopg/cursor.py:1132 ms2.3%
Connection.waitpsycopg/connection.py:4952 ms2.3%
Estimated from 52 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/orgs/tests.py:133
response = self.client.get(reverse("invitation", args=[invitation.token]))
MembersTest.test_invitations_expire · Libraries
34 ms
apps/orgs/tests.py:132
self.client.force_login(self.stranger)
MembersTest.test_invitations_expire · Database
8 ms
apps/orgs/views.py:247
invitation = get_object_or_404(Invitation.objects.select_related("organization", "invited_by"), token=token)
invitation · Database
6 ms
apps/orgs/views.py:249
member = request.user.is_authenticated and organization.is_member(request.user)
invitation · Database
4 ms
apps/orgs/tests.py:52
cls.owner = User.objects.create_user("owner", email="[email protected]")
OrganizationTestCase.setUpTestData · Database
2 ms
apps/orgs/tests.py:130
invitation = Invitation.objects.create(organization=self.organization, email="[email protected]")
MembersTest.test_invitations_expire · Database
2 ms
apps/orgs/tests.py:131
Invitation.objects.filter(pk=invitation.pk).update(date_created=timezone.now() - dt.timedelta(days=15))
MembersTest.test_invitations_expire · Database
2 ms
apps/orgs/views.py:260
return render(
invitation · App code
2 ms
apps/orgs/models.py:62
return user.is_authenticated and self.membership_set.filter(user=user).exists()
Organization.is_member · Database
2 ms
apps/orgs/views.py:33
organizations = [] if user.is_anonymous else list(Organization.objects.filter(membership__user=user))
org_shell · Database
2 ms

Fixtures

Exact setup time
_unittest_setUpClass_fixture_MembersTest class 20 ms
_django_setup_unittest class 0.27 ms
_dj_autoclear_mailbox function 0.05 ms
_django_db_marker function 0.04 ms
_template_string_if_invalid_marker function 0.04 ms
_django_set_urlconf function 0.04 ms
_django_clear_site_cache function 0.03 ms
_live_server_helper function 0.03 ms
monkeypatch function 0.02 ms

Database

41 queries · 18 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 ?
3×
SELECT %s AS "a" FROM "orgs_membership" WHERE ("orgs_membership"."organization_id" = %s AND "orgs_membership"."user_id" = %s) LIMIT ?

Biggest pieces of work

call test body
apps/orgs/tests.py:133
63 ms
setup setUpClass
django/test/testcases.py:1423
21 ms
call _post_teardown
django/test/testcases.py:1240
4 ms

Reliability

5 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 5 results, oldest first in the strip
When Environment Outcome Duration Commit
an hour ago CI github-actions:test passed 88 ms 9caa567 main Profile
an hour ago CI github-actions:test passed 81 ms ec75501 main Profile
8 hours ago CI github-actions:test passed 86 ms d2c12e5 main Profile
8 hours ago CI github-actions:test passed 41 ms 0b902f6 main Profile
8 hours ago CI github-actions:test passed 83 ms 78a4357 main Profile