Tests / starter_packs/tests.py
TestOwnerManagement::test_non_owner_cannot_cancel_invitation
First seen 14 hours ago in 0c23747
CI
github-actions:test
4 runs
Average
192 ms
median 204 ms
max 280 ms
max 280 ms
Phases
Setup 2 ms
Call 190 ms
Teardown 0.34 ms
Categories
Database 28 ms
Other (Libraries, pytest, Unsampled, Deep copies) 164 ms
25 database queries per run
Needs 40 KB of memory (max 160 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 8 hours ago ·
open run
setup0.94 ms1.2%
CallInfo.from_call_pytest/runner.py:3610.94 ms1.2%
call_and_report.<locals>.<lambda>_pytest/runner.py:2500.94 ms1.2%
HookCaller.__call__pluggy/_hooks.py:5120.94 ms1.2%
PluginManager._hookexecpluggy/_manager.py:1200.94 ms1.2%
_multicallpluggy/_callers.py:1210.94 ms1.2%
pytest_runtest_setup_pytest/runner.py:1700.94 ms1.2%
call79 ms98.5%
CallInfo.from_call_pytest/runner.py:36179 ms98.5%
call_and_report.<locals>.<lambda>_pytest/runner.py:25079 ms98.5%
HookCaller.__call__pluggy/_hooks.py:51279 ms98.5%
PluginManager._hookexecpluggy/_manager.py:12079 ms98.5%
_multicallpluggy/_callers.py:12179 ms98.5%
pytest_runtest_call_pytest/runner.py:18479 ms98.5%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:61479 ms98.5%
SimpleTestCase.__call__django/test/testcases.py:31479 ms98.5%
SimpleTestCase._setup_and_calldjango/test/testcases.py:36976 ms95.3%
TestCase.__call__<stdlib>/unittest/case.py:74776 ms95.3%
TestCase.run<stdlib>/unittest/case.py:69176 ms95.3%
TestCase._callTestMethod<stdlib>/unittest/case.py:63776 ms95.3%
TestOwnerManagement.test_non_owner_cannot_cancel_invitationstarter_packs/tests.py:558 response = self.client.post(reverse("cancel_invitation", args=[self.pack.slug, self.friend.id]))64 ms79.4%
Client.postdjango/test/client.py:116264 ms79.4%
RequestFactory.postdjango/test/client.py:49964 ms79.4%
RequestFactory.genericdjango/test/client.py:67164 ms79.4%
Client.requestdjango/test/client.py:109164 ms79.4%
ClientHandler.__call__django/test/client.py:17356 ms69.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6356 ms69.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10454 ms66.7%
WhiteNoise.add_fileswhitenoise/base.py:10854 ms66.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12041 ms50.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13138 ms47.7%
WhiteNoise.get_static_filewhitenoise/base.py:21733 ms41.3%
StaticFile.__init__whitenoise/responders.py:7220 ms25.4%
StaticFile.get_file_statswhitenoise/responders.py:16318 ms22.2%
<GC>~18 ms22.2%
StaticFile.get_file_statswhitenoise/responders.py:1613 ms3.2%
__init____init__:-13 ms3.2%
FileEntry.__init__whitenoise/responders.py:2633 ms3.2%
FileEntry.stat_regular_filewhitenoise/responders.py:2763 ms3.2%
<GC>~3 ms3.2%
StaticFile.__init__whitenoise/responders.py:7313 ms15.9%
StaticFile.get_headerswhitenoise/responders.py:1768 ms9.5%
formatdate<stdlib>/email/utils.py:2665 ms6.4%
Headers.__setitem__<stdlib>/wsgiref/headers.py:643 ms3.2%
StaticFile.get_headerswhitenoise/responders.py:1673 ms3.2%
StaticFile.get_headerswhitenoise/responders.py:1823 ms3.2%
WhiteNoise.get_static_filewhitenoise/base.py:2123 ms3.2%
WhiteNoise.add_cache_headerswhitenoise/base.py:2333 ms3.2%
WhiteNoise.get_static_filewhitenoise/base.py:2113 ms3.2%
WhiteNoise.add_mime_headerswhitenoise/base.py:2253 ms3.2%
MediaTypes.get_typewhitenoise/media_types.py:153 ms3.2%
basename<frozen posixpath>:1713 ms3.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:11510 ms12.7%
scantreewhitenoise/base.py:2718 ms9.5%
scantreewhitenoise/base.py:2718 ms9.5%
scantreewhitenoise/base.py:2735 ms6.4%
scantreewhitenoise/base.py:2713 ms3.2%
scantreewhitenoise/base.py:2733 ms3.2%
scantreewhitenoise/base.py:2693 ms3.2%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:1113 ms3.2%
WhiteNoise.add_fileswhitenoise/base.py:1083 ms3.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1203 ms3.2%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1313 ms3.2%
WhiteNoise.get_static_filewhitenoise/base.py:2173 ms3.2%
StaticFile.__init__whitenoise/responders.py:763 ms3.2%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1883 ms3.2%
ClientHandler.__call__django/test/client.py:1868 ms9.5%
BaseHandler.get_responsedjango/core/handlers/base.py:1428 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1238 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1458 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3808 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:568 ms9.5%
BaseHandler._get_responsedjango/core/handlers/base.py:1998 ms9.5%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:638 ms9.5%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:625 ms6.4%
cancel_invitationstarter_packs/views.py:4965 ms6.4%
get_editable_packstarter_packs/views.py:60 return get_object_or_404(StarterPack, slug=slug, owners=request.user, **extra)5 ms6.4%
get_object_or_404django/shortcuts.py:1005 ms6.4%
QuerySet.getdjango/db/models/query.py:7025 ms6.4%
QuerySet.__len__django/db/models/query.py:4215 ms6.4%
QuerySet._fetch_alldjango/db/models/query.py:22625 ms6.4%
ModelIterable.__iter__django/db/models/query.py:1035 ms6.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16125 ms6.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:9393 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms3.2%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1023 ms3.2%
QueryStats.addflakytest/profiling/dbtrack.py:383 ms3.2%
normalize_sqlflakytest/profiling/dbtrack.py:253 ms3.2%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:593 ms3.2%
login_required.<locals>.<lambda>django/contrib/auth/decorators.py:823 ms3.2%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2513 ms3.2%
SimpleLazyObject._setupdjango/utils/functional.py:4043 ms3.2%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:393 ms3.2%
get_userdjango/contrib/auth/middleware.py:193 ms3.2%
get_userdjango/contrib/auth/__init__.py:2873 ms3.2%
_get_user_session_keydjango/contrib/auth/__init__.py:1113 ms3.2%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:553 ms3.2%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2543 ms3.2%
SessionStore.loaddjango/contrib/sessions/backends/db.py:553 ms3.2%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:343 ms3.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms3.2%
QuerySet.getdjango/db/models/query.py:7023 ms3.2%
QuerySet.__len__django/db/models/query.py:4213 ms3.2%
QuerySet._fetch_alldjango/db/models/query.py:22623 ms3.2%
ModelIterable.__iter__django/db/models/query.py:1033 ms3.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16253 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms3.2%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms3.2%
Cursor.executepsycopg/cursor.py:1133 ms3.2%
Connection.waitpsycopg/connection.py:4953 ms3.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms3.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms3.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms3.2%
TestOwnerManagement.test_non_owner_cannot_cancel_invitationstarter_packs/tests.py:557 self.client.force_login(self.friend) # not an owner13 ms15.9%
ClientMixin.force_logindjango/test/client.py:85813 ms15.9%
ClientMixin._logindjango/test/client.py:8915 ms6.4%
SessionStore.savedjango/contrib/sessions/backends/db.py:1275 ms6.4%
Model.savedjango/db/models/base.py:9045 ms6.4%
Model.save_basedjango/db/models/base.py:9965 ms6.4%
Model._save_tabledjango/db/models/base.py:11405 ms6.4%
Model._do_updatedjango/db/models/base.py:12445 ms6.4%
QuerySet._updatedjango/db/models/query.py:14485 ms6.4%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21505 ms6.4%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21215 ms6.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16255 ms6.4%
CursorWrapper.executedjango/db/backends/utils.py:795 ms6.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:925 ms6.4%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1005 ms6.4%
CursorWrapper._executedjango/db/backends/utils.py:1055 ms6.4%
Cursor.executepsycopg/cursor.py:1135 ms6.4%
Connection.waitpsycopg/connection.py:4955 ms6.4%
ClientMixin._logindjango/test/client.py:8895 ms6.4%
logindjango/contrib/auth/__init__.py:1773 ms3.2%
SessionBase.__contains__django/contrib/sessions/backends/base.py:523 ms3.2%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2543 ms3.2%
SessionStore.loaddjango/contrib/sessions/backends/db.py:553 ms3.2%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:343 ms3.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms3.2%
QuerySet.getdjango/db/models/query.py:7023 ms3.2%
QuerySet.__len__django/db/models/query.py:4213 ms3.2%
QuerySet._fetch_alldjango/db/models/query.py:22623 ms3.2%
ModelIterable.__iter__django/db/models/query.py:1033 ms3.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16253 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms3.2%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms3.2%
Cursor.executepsycopg/cursor.py:1133 ms3.2%
Connection.waitpsycopg/connection.py:4953 ms3.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms3.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms3.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms3.2%
logindjango/contrib/auth/__init__.py:1893 ms3.2%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4373 ms3.2%
SessionStore.createdjango/contrib/sessions/backends/db.py:743 ms3.2%
SessionStore.savedjango/contrib/sessions/backends/db.py:1273 ms3.2%
Model.savedjango/db/models/base.py:9043 ms3.2%
Model.save_basedjango/db/models/base.py:9963 ms3.2%
Model._save_tabledjango/db/models/base.py:11993 ms3.2%
Model._do_insertdjango/db/models/base.py:12513 ms3.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms3.2%
QuerySet._insertdjango/db/models/query.py:21413 ms3.2%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19363 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms3.2%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms3.2%
Cursor.executepsycopg/cursor.py:1133 ms3.2%
Connection.waitpsycopg/connection.py:4953 ms3.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms3.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms3.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms3.2%
ClientMixin._logindjango/test/client.py:8843 ms3.2%
ClientMixin.sessiondjango/test/client.py:8153 ms3.2%
SessionStore.savedjango/contrib/sessions/backends/db.py:1213 ms3.2%
SessionStore.createdjango/contrib/sessions/backends/db.py:743 ms3.2%
SessionStore.savedjango/contrib/sessions/backends/db.py:1273 ms3.2%
Model.savedjango/db/models/base.py:9043 ms3.2%
Model.save_basedjango/db/models/base.py:9963 ms3.2%
Model._save_tabledjango/db/models/base.py:11993 ms3.2%
Model._do_insertdjango/db/models/base.py:12513 ms3.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms3.2%
QuerySet._insertdjango/db/models/query.py:21413 ms3.2%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19343 ms3.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms3.2%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3203 ms3.2%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2983 ms3.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms3.2%
DatabaseWrapper.create_cursordjango/db/backends/postgresql/base.py:4473 ms3.2%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3723 ms3.2%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()3 ms3.2%
TestCase._fixture_teardowndjango/test/testcases.py:14983 ms3.2%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4953 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms3.2%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms3.2%
Cursor.executepsycopg/cursor.py:1133 ms3.2%
Connection.waitpsycopg/connection.py:4953 ms3.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms3.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms3.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms3.2%
Estimated from 32 samples; phase durations are exact. Frames from pytest and pluggy are
shown
.
Hot lines in your code
|
starter_packs/tests.py:558
response = self.client.post(reverse("cancel_invitation", args=[self.pack.slug, self.friend.id]))
TestOwnerManagement.test_non_owner_cannot_cancel_invitation
· Libraries
|
59 ms |
|
starter_packs/tests.py:557
self.client.force_login(self.friend) # not an owner
TestOwnerManagement.test_non_owner_cannot_cancel_invitation
· Database
|
13 ms |
|
starter_packs/views.py:60
return get_object_or_404(StarterPack, slug=slug, owners=request.user, **extra)
get_editable_pack
· Database
|
5 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 0.12 ms |
| _django_db_marker function | 0.06 ms |
| _django_isolate_apps function | 0.05 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _django_clear_site_cache function | 0.04 ms |
| _django_set_urlconf function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
25 queries · 8 msNo repeated queries.
Biggest pieces of work
|
call test body
starter_packs/tests.py:558
|
76 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
3 ms |
| setup pytest internals | 0.94 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 | |
|---|---|---|---|---|
| 8 hours ago | CI github-actions:test | passed | 80 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 280 ms | Profile |
| 9 hours ago | CI github-actions:test | passed | 182 ms | Profile |
| 13 hours ago | CI github-actions:test | passed | 226 ms | Profile |
| 14 hours ago | CI github-actions:test | passed | 86 ms | Run |