Tests / apps/projects/tests.py
ProjectsPageTest::test_no_project
First seen 2 years, 10 months ago in b9e98d9
CI
github-actions:test
12 runs
Average
61 ms
median 67 ms
max 87 ms
max 87 ms
Phases
Setup 0.66 ms
Call 61 ms
Teardown 0.17 ms
Categories
Database 37 ms
Other (Libraries, Templates, pytest, Unsampled, ...) 24 ms
41 database queries per run
Needs 100 KB of memory (max 808 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 16 hours ago ·
open run
call66 ms98.6%
ProjectsPageTest.test_no_projectapps/projects/tests.py:110 response = self.client.get("/projects/", follow=True)37 ms54.4%
Client.getdjango/test/client.py:112418 ms27.2%
RequestFactory.getdjango/test/client.py:47518 ms27.2%
RequestFactory.genericdjango/test/client.py:67118 ms27.2%
Client.requestdjango/test/client.py:108218 ms27.2%
ClientHandler.__call__django/test/client.py:17318 ms27.2%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6218 ms27.2%
__init____init__:-118 ms27.2%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10418 ms27.2%
WhiteNoise.add_fileswhitenoise/base.py:10818 ms27.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12016 ms23.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13114 ms20.4%
WhiteNoise.get_static_filewhitenoise/base.py:2087 ms10.2%
StaticFile.__init__whitenoise/responders.py:772 ms3.4%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms3.4%
StaticFile.__init__whitenoise/responders.py:722 ms3.4%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms3.4%
StaticFile.__init__whitenoise/responders.py:732 ms3.4%
StaticFile.get_headerswhitenoise/responders.py:1812 ms3.4%
WhiteNoise.get_static_filewhitenoise/base.py:2037 ms10.2%
WhiteNoise.add_cache_headerswhitenoise/base.py:2247 ms10.2%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1767 ms10.2%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1977 ms10.2%
URLMixin.urldebug_toolbar/panels/staticfiles.py:205 ms6.8%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms3.4%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1862 ms3.4%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2092 ms3.4%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1232 ms3.4%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms3.4%
scantreewhitenoise/base.py:2602 ms3.4%
Client.getdjango/test/client.py:113318 ms27.2%
Client._handle_redirectsdjango/test/client.py:138418 ms27.2%
ClientMixin._follow_redirectdjango/test/client.py:100218 ms27.2%
Client.getdjango/test/client.py:112418 ms27.2%
RequestFactory.getdjango/test/client.py:47518 ms27.2%
RequestFactory.genericdjango/test/client.py:67118 ms27.2%
Client.requestdjango/test/client.py:108218 ms27.2%
ClientHandler.__call__django/test/client.py:18618 ms27.2%
BaseHandler.get_responsedjango/core/handlers/base.py:14118 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13018 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12318 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3418 ms27.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms27.2%
BaseHandler._get_responsedjango/core/handlers/base.py:19818 ms27.2%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:5911 ms17.0%
project_createapps/orgs/views.py:12511 ms17.0%
member_organizationapps/orgs/views.py:59 organization = get_object_or_404(Organization, slug=org_slug)9 ms13.6%
get_object_or_404django/shortcuts.py:909 ms13.6%
QuerySet.getdjango/db/models/query.py:6357 ms10.2%
QuerySet.__len__django/db/models/query.py:3727 ms10.2%
QuerySet._fetch_alldjango/db/models/query.py:20007 ms10.2%
ModelIterable.__iter__django/db/models/query.py:955 ms6.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms3.4%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms3.4%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms3.4%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2942 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
BaseCursor._execute_genpsycopg/_cursor_base.py:2052 ms3.4%
BaseCursor._convert_querypsycopg/_cursor_base.py:4652 ms3.4%
PostgresClientQuery.convertpsycopg/_queries.py:2892 ms3.4%
ModelIterable.__iter__django/db/models/query.py:1272 ms3.4%
QuerySet.getdjango/db/models/query.py:6252 ms3.4%
QuerySet.filterdjango/db/models/query.py:15422 ms3.4%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms3.4%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms3.4%
Query.add_qdjango/db/models/sql/query.py:16712 ms3.4%
Query._add_qdjango/db/models/sql/query.py:17152 ms3.4%
member_organizationapps/orgs/views.py:622 ms3.4%
Organization.is_memberapps/orgs/models.py:62 return user.is_authenticated and self.membership_set.filter(user=user).exists()2 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
QuerySet.filterdjango/db/models/query.py:15422 ms3.4%
QuerySet._filter_or_excludedjango/db/models/query.py:15552 ms3.4%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:567 ms10.2%
login_required.<locals>.<lambda>django/contrib/auth/decorators.py:797 ms10.2%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2517 ms10.2%
SimpleLazyObject._setupdjango/utils/functional.py:4047 ms10.2%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:407 ms10.2%
get_userdjango/contrib/auth/middleware.py:207 ms10.2%
get_userdjango/contrib/auth/__init__.py:3187 ms10.2%
ModelBackend.get_userdjango/contrib/auth/backends.py:2327 ms10.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:877 ms10.2%
QuerySet.getdjango/db/models/query.py:6357 ms10.2%
QuerySet.__len__django/db/models/query.py:3727 ms10.2%
QuerySet._fetch_alldjango/db/models/query.py:20007 ms10.2%
ModelIterable.__iter__django/db/models/query.py:957 ms10.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16245 ms6.8%
CursorWrapper.executedjango/db/backends/utils.py:795 ms6.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:925 ms6.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms3.4%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms3.4%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16222 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3202 ms3.4%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2982 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
DatabaseWrapper.create_cursordjango/db/backends/postgresql/base.py:4302 ms3.4%
Connection.cursorpsycopg/connection.py:2592 ms3.4%
ProjectsPageTest.test_no_projectapps/projects/tests.py:111 organization = Membership.objects.get(user=self.user).organization # created for them14 ms20.4%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:25714 ms20.4%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:22214 ms20.4%
QuerySet.getdjango/db/models/query.py:63514 ms20.4%
QuerySet.__len__django/db/models/query.py:37214 ms20.4%
QuerySet._fetch_alldjango/db/models/query.py:200014 ms20.4%
ModelIterable.__iter__django/db/models/query.py:9511 ms17.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162411 ms17.0%
CursorWrapper.executedjango/db/backends/utils.py:7911 ms17.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9211 ms17.0%
CursorWrapper._executedjango/db/backends/utils.py:10511 ms17.0%
Cursor.executepsycopg/cursor.py:11311 ms17.0%
Connection.waitpsycopg/connection.py:49511 ms17.0%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms3.4%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:3182 ms3.4%
ModelIterable.__iter__django/db/models/query.py:1272 ms3.4%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()11 ms17.0%
TestCase._fixture_teardowndjango/test/testcases.py:149411 ms17.0%
TestCase._should_check_constraintsdjango/test/testcases.py:150311 ms17.0%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:49211 ms17.0%
Cursor.executepsycopg/cursor.py:11311 ms17.0%
Connection.waitpsycopg/connection.py:49511 ms17.0%
BaseCursor._execute_genpsycopg/_cursor_base.py:20611 ms17.0%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28611 ms17.0%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7811 ms17.0%
ProjectsPageTest.setUpapps/projects/tests.py:101 self.client.force_login(self.user)2 ms3.4%
ClientMixin.force_logindjango/test/client.py:8552 ms3.4%
ClientMixin._logindjango/test/client.py:8762 ms3.4%
ClientMixin.sessiondjango/test/client.py:8122 ms3.4%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms3.4%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms3.4%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms3.4%
Atomic.__enter__django/db/transaction.py:2112 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms3.4%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
ProjectsPageTest.test_no_projectapps/projects/tests.py:112 self.assertRedirects(response, reverse("project_create", args=[organization.slug]))2 ms3.4%
reversedjango/urls/base.py:442 ms3.4%
get_script_prefixdjango/urls/base.py:1352 ms3.4%
Estimated from 29 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/projects/tests.py:110
response = self.client.get("/projects/", follow=True)
ProjectsPageTest.test_no_project
· Libraries
|
25 ms |
|
apps/projects/tests.py:111
organization = Membership.objects.get(user=self.user).organization # created for them
ProjectsPageTest.test_no_project
· Database
|
14 ms |
|
apps/orgs/views.py:59
organization = get_object_or_404(Organization, slug=org_slug)
member_organization
· Database
|
9 ms |
|
apps/projects/tests.py:101
self.client.force_login(self.user)
ProjectsPageTest.setUp
· Database
|
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/projects/tests.py:112
self.assertRedirects(response, reverse("project_create", args=[organization.slug]))
ProjectsPageTest.test_no_project
· Libraries
|
2 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 0.06 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _django_set_urlconf function | 0.04 ms |
| _live_server_helper function | 0.04 ms |
| _django_db_marker function | 0.04 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.03 ms |
Database
41 queries · 11 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
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:111
|
53 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
11 ms |
|
call setUp
apps/projects/tests.py:101
|
2 ms |
Reliability
12 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 12 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 16 hours ago | CI github-actions:test | passed | 67 ms | Profile |
| 1 week, 5 days ago | CI github-actions:test | passed | 36 ms | Profile |
| 2 weeks, 1 day ago | CI github-actions:test | passed | 73 ms | Profile |
| 2 weeks, 1 day ago | CI github-actions:test | passed | 50 ms | Profile |
| 2 weeks, 1 day ago | CI github-actions:test | passed | 79 ms | Profile |
| 2 weeks, 2 days ago | CI github-actions:test | passed | 40 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 66 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 87 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 62 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 73 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 35 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 68 ms | Profile |