Tests / apps/projects/tests.py
TestProjectTestPage::test_other_peoples_project
First seen 2 years, 11 months ago in d87c7a8
CI
github-actions:test
15 runs
Average
99 ms
median 61 ms
max 223 ms
max 223 ms
Phases
Setup 0.67 ms
Call 98 ms
Teardown 0.16 ms
Categories
Database 19 ms
App code 0.14 ms
Other (Libraries, Unsampled, pytest) 80 ms
33 database queries per run
Needs 291 KB of memory (max 836 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call41 ms98.4%
TestProjectTestPage.test_other_peoples_projectapps/projects/tests.py:425 response = self.client.get(self.url)28 ms65.6%
Client.getdjango/test/client.py:112428 ms65.6%
RequestFactory.getdjango/test/client.py:47528 ms65.6%
RequestFactory.genericdjango/test/client.py:67128 ms65.6%
Client.requestdjango/test/client.py:108228 ms65.6%
ClientHandler.__call__django/test/client.py:17318 ms43.7%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6218 ms43.7%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10418 ms43.7%
WhiteNoise.add_fileswhitenoise/base.py:10818 ms43.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12018 ms43.7%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13118 ms43.7%
WhiteNoise.get_static_filewhitenoise/base.py:20312 ms29.1%
WhiteNoise.add_cache_headerswhitenoise/base.py:22412 ms29.1%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:17612 ms29.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:19712 ms29.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:2111 ms25.5%
<GC>~11 ms25.5%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms3.6%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms3.6%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1862 ms3.6%
WhiteNoise.get_static_filewhitenoise/base.py:2086 ms14.6%
StaticFile.__init__whitenoise/responders.py:763 ms7.3%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms3.6%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms3.6%
StaticFile.__init__whitenoise/responders.py:722 ms3.6%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms3.6%
__init____init__:-12 ms3.6%
FileEntry.__init__whitenoise/responders.py:2632 ms3.6%
StaticFile.__init__whitenoise/responders.py:732 ms3.6%
StaticFile.get_headerswhitenoise/responders.py:1672 ms3.6%
ClientHandler.__call__django/test/client.py:1869 ms21.9%
BaseHandler.get_responsedjango/core/handlers/base.py:1419 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1309 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1239 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3099 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:349 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:559 ms21.9%
BaseHandler._get_responsedjango/core/handlers/base.py:1989 ms21.9%
project_testapps/projects/urls.py:2829 ms21.9%
find_projectapps/projects/urls.py:529 ms21.9%
can_viewapps/projects/urls.py:339 ms21.9%
can_manage_projectapps/projects/urls.py:40 return user.is_superuser or project.organization.membership_set.filter(user=user).exists()9 ms21.9%
QuerySet.existsdjango/db/models/query.py:13379 ms21.9%
Query.has_resultsdjango/db/models/sql/query.py:6819 ms21.9%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15929 ms21.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16249 ms21.9%
CursorWrapper.executedjango/db/backends/utils.py:799 ms21.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:929 ms21.9%
CursorWrapper._executedjango/db/backends/utils.py:1059 ms21.9%
Cursor.executepsycopg/cursor.py:1139 ms21.9%
Connection.waitpsycopg/connection.py:4959 ms21.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:2069 ms21.9%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2868 ms18.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:788 ms18.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:3122 ms3.6%
TestProjectTestPage.setUpapps/projects/tests.py:413 self.client.force_login(self.user)5 ms10.9%
ClientMixin.force_logindjango/test/client.py:8555 ms10.9%
ClientMixin._logindjango/test/client.py:8762 ms3.6%
ClientMixin.sessiondjango/test/client.py:8122 ms3.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms3.6%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms3.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms3.6%
Model.savedjango/db/models/base.py:8742 ms3.6%
Model.save_basedjango/db/models/base.py:9662 ms3.6%
Model._save_tabledjango/db/models/base.py:11672 ms3.6%
Model._do_insertdjango/db/models/base.py:12182 ms3.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.6%
ClientMixin._logindjango/test/client.py:8812 ms3.6%
logindjango/contrib/auth/__init__.py:1872 ms3.6%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4342 ms3.6%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms3.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms3.6%
Model.savedjango/db/models/base.py:8742 ms3.6%
Model.save_basedjango/db/models/base.py:9662 ms3.6%
Model._save_tabledjango/db/models/base.py:11672 ms3.6%
Model._do_insertdjango/db/models/base.py:12182 ms3.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.6%
QuerySet._insertdjango/db/models/query.py:19182 ms3.6%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19242 ms3.6%
SQLInsertCompiler.as_sqldjango/db/models/sql/compiler.py:18692 ms3.6%
ClientMixin._logindjango/test/client.py:8832 ms3.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms3.6%
Atomic.__enter__django/db/transaction.py:2112 ms3.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.6%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms3.6%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms3.6%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.6%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.6%
Cursor.executepsycopg/cursor.py:1132 ms3.6%
Connection.waitpsycopg/connection.py:4952 ms3.6%
TestProjectTestPage.test_other_peoples_projectapps/projects/tests.py:424 self.client.force_login(other_user)5 ms10.9%
ClientMixin.force_logindjango/test/client.py:8555 ms10.9%
ClientMixin._logindjango/test/client.py:8813 ms7.3%
logindjango/contrib/auth/__init__.py:1752 ms3.6%
SessionBase.__contains__django/contrib/sessions/backends/base.py:522 ms3.6%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms3.6%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms3.6%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms3.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.6%
QuerySet.getdjango/db/models/query.py:6352 ms3.6%
QuerySet.__len__django/db/models/query.py:3722 ms3.6%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.6%
ModelIterable.__iter__django/db/models/query.py:952 ms3.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.6%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.6%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.6%
Cursor.executepsycopg/cursor.py:1132 ms3.6%
Connection.waitpsycopg/connection.py:4952 ms3.6%
logindjango/contrib/auth/__init__.py:1852 ms3.6%
SessionBase.flushdjango/contrib/sessions/backends/base.py:4202 ms3.6%
SessionStore.deletedjango/contrib/sessions/backends/db.py:1752 ms3.6%
Model.deletedjango/db/models/base.py:12982 ms3.6%
Collector.deletedjango/db/models/deletion.py:4522 ms3.6%
DeleteQuery.delete_batchdjango/db/models/sql/subqueries.py:432 ms3.6%
DeleteQuery.do_querydjango/db/models/sql/subqueries.py:252 ms3.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.6%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.6%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.6%
Cursor.executepsycopg/cursor.py:1132 ms3.6%
Connection.waitpsycopg/connection.py:4952 ms3.6%
ClientMixin._logindjango/test/client.py:8832 ms3.6%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms3.6%
SessionStore.createdjango/contrib/sessions/backends/db.py:702 ms3.6%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1982 ms3.6%
SessionStore.existsdjango/contrib/sessions/backends/db.py:632 ms3.6%
QuerySet.existsdjango/db/models/query.py:13372 ms3.6%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms3.6%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms3.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.6%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.6%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.6%
Cursor.executepsycopg/cursor.py:1132 ms3.6%
Connection.waitpsycopg/connection.py:4952 ms3.6%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms3.6%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms3.6%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms3.6%
TestProjectTestPage.test_other_peoples_projectapps/projects/tests.py:423 other_user = User.objects.create_user("otheruser")2 ms3.6%
UserManager.create_userdjango/contrib/auth/models.py:1752 ms3.6%
UserManager._create_userdjango/contrib/auth/models.py:1632 ms3.6%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms3.6%
Model.savedjango/db/models/base.py:8742 ms3.6%
Model.save_basedjango/db/models/base.py:9662 ms3.6%
Model._save_tabledjango/db/models/base.py:11672 ms3.6%
Model._do_insertdjango/db/models/base.py:12182 ms3.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.6%
QuerySet._insertdjango/db/models/query.py:19182 ms3.6%
Estimated from 27 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/projects/tests.py:425
response = self.client.get(self.url)
TestProjectTestPage.test_other_peoples_project
· Libraries
|
18 ms |
|
apps/projects/urls.py:40
return user.is_superuser or project.organization.membership_set.filter(user=user).exists()
can_manage_project
· Database
|
9 ms |
|
apps/projects/tests.py:413
self.client.force_login(self.user)
TestProjectTestPage.setUp
· Database
|
5 ms |
|
apps/projects/tests.py:424
self.client.force_login(other_user)
TestProjectTestPage.test_other_peoples_project
· Database
|
5 ms |
|
apps/projects/tests.py:423
other_user = User.objects.create_user("otheruser")
TestProjectTestPage.test_other_peoples_project
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.05 ms |
| _django_db_marker function | 0.03 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _django_clear_site_cache function | 0.02 ms |
| _live_server_helper function | 0.02 ms |
| monkeypatch function | 0.01 ms |
Database
33 queries · 6 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
SELECT %s AS "a" FROM "django_session" WHERE "django_session"."session_key" = %s LIMIT ?
3×
INSERT INTO "django_session" ("session_key", "session_data", "expire_date") VALUES (%s, %s, %s)
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 test body
apps/projects/tests.py:425
|
34 ms |
|
call setUp
apps/projects/tests.py:413
|
5 ms |
| call pytest internals | 3 ms |
Reliability
15 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 15 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 42 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 61 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 29 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 69 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 159 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 213 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 191 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 223 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 188 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 55 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 54 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 53 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 61 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 30 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 57 ms | Profile |