Tests / ft/tests.py
TestProjectsHome::test_user_logged_in_with_multiple_projects
First seen 8 hours ago in 78a4357
CI
github-actions:test
5 runs
Average
52 ms
median 56 ms
max 62 ms
max 62 ms
Phases
Setup 0.76 ms
Call 51 ms
Teardown 0.16 ms
Categories
Database 24 ms
Other (Libraries, Unsampled) 28 ms
37 database queries per run
Needs 118 KB of memory (max 432 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, an hour ago ·
open run
call57 ms98.2%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:52 response = self.client.get(reverse("projects"))23 ms40.2%
Client.getdjango/test/client.py:112423 ms40.2%
RequestFactory.getdjango/test/client.py:47523 ms40.2%
RequestFactory.genericdjango/test/client.py:67123 ms40.2%
Client.requestdjango/test/client.py:108223 ms40.2%
ClientHandler.__call__django/test/client.py:17318 ms31.3%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6218 ms31.3%
__init____init__:-118 ms31.3%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10418 ms31.3%
WhiteNoise.add_fileswhitenoise/base.py:10818 ms31.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12013 ms22.3%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13113 ms22.3%
WhiteNoise.get_static_filewhitenoise/base.py:20810 ms17.9%
StaticFile.__init__whitenoise/responders.py:735 ms8.9%
StaticFile.get_headerswhitenoise/responders.py:1713 ms4.5%
StaticFile.get_headerswhitenoise/responders.py:1763 ms4.5%
formatdate<stdlib>/email/utils.py:2663 ms4.5%
StaticFile.__init__whitenoise/responders.py:743 ms4.5%
parsedate<stdlib>/email/_parseaddr.py:1853 ms4.5%
WhiteNoise.get_static_filewhitenoise/base.py:2023 ms4.5%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms8.9%
scantreewhitenoise/base.py:2625 ms8.9%
scantreewhitenoise/base.py:2625 ms8.9%
scantreewhitenoise/base.py:2643 ms4.5%
scantreewhitenoise/base.py:2623 ms4.5%
ClientHandler.__call__django/test/client.py:1865 ms8.9%
BaseHandler.get_responsedjango/core/handlers/base.py:1415 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1305 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1235 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:345 ms8.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms8.9%
BaseHandler._get_responsedjango/core/handlers/base.py:1985 ms8.9%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:595 ms8.9%
homeapps/orgs/views.py:74 if not projects.exists():3 ms4.5%
QuerySet.existsdjango/db/models/query.py:13373 ms4.5%
Query.has_resultsdjango/db/models/sql/query.py:6813 ms4.5%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15923 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
homeapps/orgs/views.py:77 if in_organization.count() == 1:3 ms4.5%
QuerySet.countdjango/db/models/query.py:6103 ms4.5%
Query.get_countdjango/db/models/sql/query.py:6513 ms4.5%
Query.get_aggregationdjango/db/models/sql/query.py:6333 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:51 self.client.force_login(user)10 ms17.9%
ClientMixin.force_logindjango/test/client.py:85510 ms17.9%
ClientMixin._logindjango/test/client.py:8815 ms8.9%
logindjango/contrib/auth/__init__.py:1873 ms4.5%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4343 ms4.5%
SessionStore.createdjango/contrib/sessions/backends/db.py:703 ms4.5%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1983 ms4.5%
SessionStore.existsdjango/contrib/sessions/backends/db.py:633 ms4.5%
QuerySet.existsdjango/db/models/query.py:13373 ms4.5%
Query.has_resultsdjango/db/models/sql/query.py:6813 ms4.5%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15923 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
logindjango/contrib/auth/__init__.py:1973 ms4.5%
Signal.senddjango/dispatch/dispatcher.py:2093 ms4.5%
update_last_logindjango/contrib/auth/models.py:243 ms4.5%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:623 ms4.5%
Model.savedjango/db/models/base.py:8743 ms4.5%
Model.save_basedjango/db/models/base.py:9663 ms4.5%
Model._save_tabledjango/db/models/base.py:11103 ms4.5%
Model._do_updatedjango/db/models/base.py:12113 ms4.5%
QuerySet._updatedjango/db/models/query.py:13273 ms4.5%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21403 ms4.5%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21113 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
ClientMixin._logindjango/test/client.py:8763 ms4.5%
ClientMixin.sessiondjango/test/client.py:8123 ms4.5%
SessionStore.savedjango/contrib/sessions/backends/db.py:1213 ms4.5%
SessionStore.createdjango/contrib/sessions/backends/db.py:703 ms4.5%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1983 ms4.5%
SessionStore.existsdjango/contrib/sessions/backends/db.py:633 ms4.5%
QuerySet.existsdjango/db/models/query.py:13373 ms4.5%
Query.has_resultsdjango/db/models/sql/query.py:6813 ms4.5%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15923 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16113 ms4.5%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7673 ms4.5%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:863 ms4.5%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:753 ms4.5%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3173 ms4.5%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5783 ms4.5%
Value.as_sqldjango/db/models/expressions.py:11703 ms4.5%
BaseExpression._output_field_or_nonedjango/db/models/expressions.py:3423 ms4.5%
cached_property.__get__django/utils/functional.py:473 ms4.5%
BaseExpression.output_fielddjango/db/models/expressions.py:3283 ms4.5%
Value._resolve_output_fielddjango/db/models/expressions.py:12013 ms4.5%
ClientMixin._logindjango/test/client.py:8833 ms4.5%
SessionStore.savedjango/contrib/sessions/backends/db.py:1273 ms4.5%
Model.savedjango/db/models/base.py:8743 ms4.5%
Model.save_basedjango/db/models/base.py:9663 ms4.5%
Model._save_tabledjango/db/models/base.py:11103 ms4.5%
Model._do_updatedjango/db/models/base.py:12113 ms4.5%
QuerySet._updatedjango/db/models/query.py:13273 ms4.5%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21403 ms4.5%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21113 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:485 ms8.9%
make_projectapps/projects/testing.py:623 ms4.5%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():3 ms4.5%
QuerySet.existsdjango/db/models/query.py:13373 ms4.5%
Query.has_resultsdjango/db/models/sql/query.py:6813 ms4.5%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15923 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms4.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms4.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms4.5%
make_projectapps/projects/testing.py:64 project = Project.objects.create(3 ms4.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms4.5%
QuerySet.createdjango/db/models/query.py:6693 ms4.5%
Model.savedjango/db/models/base.py:8743 ms4.5%
Model.save_basedjango/db/models/base.py:9663 ms4.5%
Model._save_tabledjango/db/models/base.py:11673 ms4.5%
Model._do_insertdjango/db/models/base.py:12183 ms4.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms4.5%
QuerySet._insertdjango/db/models/query.py:19183 ms4.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19253 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2053 ms4.5%
BaseCursor._convert_querypsycopg/_cursor_base.py:4653 ms4.5%
PostgresClientQuery.convertpsycopg/_queries.py:2893 ms4.5%
PostgresClientQuery.dumppsycopg/_queries.py:2993 ms4.5%
PostgresClientQuery.dump.<locals>.<genexpr>psycopg/_queries.py:3003 ms4.5%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:495 ms8.9%
add_memberapps/projects/testing.py:76 membership, _ = Membership.objects.get_or_create(5 ms8.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:875 ms8.9%
QuerySet.get_or_createdjango/db/models/query.py:9873 ms4.5%
QuerySet.getdjango/db/models/query.py:6353 ms4.5%
QuerySet.__len__django/db/models/query.py:3723 ms4.5%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms4.5%
ModelIterable.__iter__django/db/models/query.py:953 ms4.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
QuerySet.get_or_createdjango/db/models/query.py:9943 ms4.5%
QuerySet.createdjango/db/models/query.py:6693 ms4.5%
Model.savedjango/db/models/base.py:8743 ms4.5%
Model.save_basedjango/db/models/base.py:9663 ms4.5%
Model._save_tabledjango/db/models/base.py:11673 ms4.5%
Model._do_insertdjango/db/models/base.py:12183 ms4.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms4.5%
QuerySet._insertdjango/db/models/query.py:19183 ms4.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19253 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:505 ms8.9%
make_projectapps/projects/testing.py:67 slug=unique_slug(name, organization.project_set.all(), fallback="project", reserved=RESERVED_PROJECT_SLUGS),5 ms8.9%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():5 ms8.9%
QuerySet.existsdjango/db/models/query.py:13375 ms8.9%
Query.has_resultsdjango/db/models/sql/query.py:6815 ms8.9%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15925 ms8.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16245 ms8.9%
CursorWrapper.executedjango/db/backends/utils.py:795 ms8.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:925 ms8.9%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()5 ms8.9%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms4.5%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4833 ms4.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms4.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms4.5%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms4.5%
Cursor.executepsycopg/cursor.py:1133 ms4.5%
Connection.waitpsycopg/connection.py:4953 ms4.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms4.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:3043 ms4.5%
TestCase._fixture_teardowndjango/test/testcases.py:14973 ms4.5%
TestCase._rollback_atomicsdjango/test/testcases.py:14053 ms4.5%
Atomic.__exit__django/db/transaction.py:2863 ms4.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms4.5%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4313 ms4.5%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3743 ms4.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms4.5%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:47 user = User.objects.create_user("testuser")3 ms4.5%
UserManager.create_userdjango/contrib/auth/models.py:1753 ms4.5%
UserManager._create_userdjango/contrib/auth/models.py:1633 ms4.5%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:623 ms4.5%
Model.savedjango/db/models/base.py:8743 ms4.5%
Model.save_basedjango/db/models/base.py:9663 ms4.5%
Model._save_tabledjango/db/models/base.py:11673 ms4.5%
Model._do_insertdjango/db/models/base.py:12183 ms4.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms4.5%
QuerySet._insertdjango/db/models/query.py:19183 ms4.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19243 ms4.5%
SQLInsertCompiler.as_sqldjango/db/models/sql/compiler.py:18133 ms4.5%
Estimated from 22 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
ft/tests.py:52
response = self.client.get(reverse("projects"))
TestProjectsHome.test_user_logged_in_with_multiple_projects
· Libraries
|
18 ms |
|
ft/tests.py:51
self.client.force_login(user)
TestProjectsHome.test_user_logged_in_with_multiple_projects
· Database
|
10 ms |
|
apps/orgs/models.py:46
while slug in reserved or taken.filter(slug=slug).exists():
unique_slug
· Database
|
8 ms |
|
apps/projects/testing.py:76
membership, _ = Membership.objects.get_or_create(
add_member
· Database
|
5 ms |
|
ft/tests.py:47
user = User.objects.create_user("testuser")
TestProjectsHome.test_user_logged_in_with_multiple_projects
· Database
|
3 ms |
|
apps/projects/testing.py:64
project = Project.objects.create(
make_project
· Database
|
3 ms |
|
apps/orgs/views.py:74
if not projects.exists():
home
· Database
|
3 ms |
|
apps/orgs/views.py:77
if in_organization.count() == 1:
home
· Database
|
3 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 0.06 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _live_server_helper function | 0.05 ms |
| _django_db_marker function | 0.05 ms |
| _django_set_urlconf function | 0.04 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.03 ms |
Database
37 queries · 13 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
SELECT %s AS "a" FROM "projects_project" WHERE ("projects_project"."organization_id" = %s AND "projects_project"."slug" = %s) LIMIT ?
Biggest pieces of work
|
call test body
ft/tests.py:47
|
52 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
5 ms |
Reliability
5 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 5 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| an hour ago | CI github-actions:test | passed | 58 ms | Profile |
| an hour ago | CI github-actions:test | passed | 56 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 62 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 28 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 56 ms | Profile |