Tests / starter_packs/tests.py
TestOwnerManagement::test_decline_invitation_removes_it
First seen 14 hours ago in 0c23747
CI
github-actions:test
4 runs
Average
160 ms
median 155 ms
max 245 ms
max 245 ms
Phases
Setup 2 ms
Call 157 ms
Teardown 0.43 ms
Categories
Database 32 ms
Other (Libraries, pytest, Unsampled, Deep copies) 128 ms
27 database queries per run
Needs 262 KB of memory (max 360 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 8 hours ago ·
open run
call81 ms98.4%
TestOwnerManagement.test_decline_invitation_removes_itstarter_packs/tests.py:602 response = self.client.post(reverse("decline_invitation", args=[self.pack.slug]))63 ms77.1%
Client.postdjango/test/client.py:116263 ms77.1%
RequestFactory.postdjango/test/client.py:49963 ms77.1%
RequestFactory.genericdjango/test/client.py:67163 ms77.1%
Client.requestdjango/test/client.py:109163 ms77.1%
ClientHandler.__call__django/test/client.py:17352 ms63.8%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6352 ms63.8%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10452 ms63.8%
WhiteNoise.add_fileswhitenoise/base.py:10852 ms63.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12050 ms61.1%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13148 ms58.5%
WhiteNoise.get_static_filewhitenoise/base.py:21742 ms50.5%
StaticFile.__init__whitenoise/responders.py:7224 ms29.2%
StaticFile.get_file_statswhitenoise/responders.py:16320 ms23.9%
<GC>~20 ms23.9%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms2.7%
formatdate<stdlib>/email/utils.py:2662 ms2.7%
Headers.__init__<stdlib>/wsgiref/headers.py:432 ms2.7%
StaticFile.get_file_statswhitenoise/responders.py:1642 ms2.7%
StaticFile.__init__whitenoise/responders.py:774 ms5.3%
StaticFile.get_alternativeswhitenoise/responders.py:1982 ms2.7%
StaticFile.get_alternativeswhitenoise/responders.py:2012 ms2.7%
StaticFile.__init__whitenoise/responders.py:752 ms2.7%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms2.7%
StaticFile.__init__whitenoise/responders.py:742 ms2.7%
parsedate<stdlib>/email/_parseaddr.py:1852 ms2.7%
StaticFile.__init__whitenoise/responders.py:732 ms2.7%
StaticFile.get_headerswhitenoise/responders.py:1762 ms2.7%
Headers.__setitem__<stdlib>/wsgiref/headers.py:642 ms2.7%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:492 ms2.7%
StaticFile.__init__whitenoise/responders.py:762 ms2.7%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms2.7%
WhiteNoise.get_static_filewhitenoise/base.py:2127 ms8.0%
WhiteNoise.add_cache_headerswhitenoise/base.py:2337 ms8.0%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1764 ms5.3%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1974 ms5.3%
URLMixin.urldebug_toolbar/panels/staticfiles.py:204 ms5.3%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2352 ms2.7%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2162 ms2.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms2.7%
scantreewhitenoise/base.py:2712 ms2.7%
scantreewhitenoise/base.py:2712 ms2.7%
scantreewhitenoise/base.py:2732 ms2.7%
ClientHandler.__call__django/test/client.py:1869 ms10.6%
BaseHandler.get_responsedjango/core/handlers/base.py:1429 ms10.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:569 ms10.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3809 ms10.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:569 ms10.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1237 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1457 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3807 ms8.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:567 ms8.0%
BaseHandler._get_responsedjango/core/handlers/base.py:1997 ms8.0%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:637 ms8.0%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:624 ms5.3%
decline_invitationstarter_packs/views.py:540 starter_pack = get_object_or_404(StarterPack, slug=starter_pack_slug, deleted_at__isnull=True)2 ms2.7%
get_object_or_404django/shortcuts.py:1002 ms2.7%
QuerySet.getdjango/db/models/query.py:7022 ms2.7%
QuerySet.__len__django/db/models/query.py:4212 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms2.7%
ModelIterable.__iter__django/db/models/query.py:1032 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
decline_invitationstarter_packs/views.py:541 StarterPackInvitation.objects.filter(starter_pack=starter_pack, invited_user=request.user).delete()2 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet.filterdjango/db/models/query.py:16762 ms2.7%
QuerySet._filter_or_excludedjango/db/models/query.py:16942 ms2.7%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:17042 ms2.7%
Query.add_qdjango/db/models/sql/query.py:16812 ms2.7%
Query._add_qdjango/db/models/sql/query.py:17132 ms2.7%
Query.build_filterdjango/db/models/sql/query.py:15772 ms2.7%
Query.setup_joinsdjango/db/models/sql/query.py:20022 ms2.7%
Query.joindjango/db/models/sql/query.py:11512 ms2.7%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:592 ms2.7%
login_required.<locals>.<lambda>django/contrib/auth/decorators.py:822 ms2.7%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2512 ms2.7%
SimpleLazyObject._setupdjango/utils/functional.py:4042 ms2.7%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:392 ms2.7%
get_userdjango/contrib/auth/middleware.py:192 ms2.7%
get_userdjango/contrib/auth/__init__.py:2872 ms2.7%
_get_user_session_keydjango/contrib/auth/__init__.py:1112 ms2.7%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:552 ms2.7%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2542 ms2.7%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms2.7%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet.getdjango/db/models/query.py:7022 ms2.7%
QuerySet.__len__django/db/models/query.py:4212 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms2.7%
ModelIterable.__iter__django/db/models/query.py:1032 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
MiddlewareMixin.__call__django/utils/deprecation.py:3822 ms2.7%
CSPMiddleware.process_responsecsp/middleware.py:832 ms2.7%
build_policycsp/utils.py:822 ms2.7%
default_configcsp/utils.py:632 ms2.7%
TestOwnerManagement.test_decline_invitation_removes_itstarter_packs/tests.py:601 self.client.force_login(self.friend)9 ms10.6%
ClientMixin.force_logindjango/test/client.py:8589 ms10.6%
ClientMixin._logindjango/test/client.py:8897 ms8.0%
logindjango/contrib/auth/__init__.py:1894 ms5.3%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4404 ms5.3%
SessionStore.deletedjango/contrib/sessions/backends/db.py:1754 ms5.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms5.3%
QuerySet.getdjango/db/models/query.py:7024 ms5.3%
QuerySet.__len__django/db/models/query.py:4214 ms5.3%
QuerySet._fetch_alldjango/db/models/query.py:22624 ms5.3%
ModelIterable.__iter__django/db/models/query.py:1034 ms5.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16254 ms5.3%
CursorWrapper.executedjango/db/backends/utils.py:794 ms5.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:924 ms5.3%
CursorWrapper._executedjango/db/backends/utils.py:1054 ms5.3%
Cursor.executepsycopg/cursor.py:1134 ms5.3%
Connection.waitpsycopg/connection.py:4954 ms5.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2064 ms5.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2864 ms5.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:784 ms5.3%
logindjango/contrib/auth/__init__.py:1982 ms2.7%
Signal.senddjango/dispatch/dispatcher.py:2492 ms2.7%
update_last_logindjango/contrib/auth/models.py:242 ms2.7%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms2.7%
Model.savedjango/db/models/base.py:9042 ms2.7%
Model.save_basedjango/db/models/base.py:9962 ms2.7%
Model._save_tabledjango/db/models/base.py:11402 ms2.7%
Model._do_updatedjango/db/models/base.py:12442 ms2.7%
QuerySet._updatedjango/db/models/query.py:14482 ms2.7%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21502 ms2.7%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21212 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
ClientMixin._logindjango/test/client.py:8912 ms2.7%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms2.7%
Model.savedjango/db/models/base.py:9042 ms2.7%
Model.save_basedjango/db/models/base.py:9962 ms2.7%
Model._save_tabledjango/db/models/base.py:11402 ms2.7%
Model._do_updatedjango/db/models/base.py:12442 ms2.7%
QuerySet._updatedjango/db/models/query.py:14482 ms2.7%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21502 ms2.7%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21212 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
TestOwnerManagement.test_decline_invitation_removes_itstarter_packs/tests.py:600 StarterPackInvitation.objects.create(starter_pack=self.pack, invited_user=self.friend, invited_by=self.owner)2 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet.createdjango/db/models/query.py:7362 ms2.7%
Model.savedjango/db/models/base.py:9042 ms2.7%
Model.save_basedjango/db/models/base.py:9962 ms2.7%
Model._save_tabledjango/db/models/base.py:11992 ms2.7%
Model._do_insertdjango/db/models/base.py:12512 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet._insertdjango/db/models/query.py:21412 ms2.7%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19362 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
TestOwnerManagement.test_decline_invitation_removes_itstarter_packs/tests.py:604 self.assertFalse(self.pack.invitations.filter(invited_user=self.friend).exists())2 ms2.7%
QuerySet.existsdjango/db/models/query.py:14582 ms2.7%
Query.has_resultsdjango/db/models/sql/query.py:6872 ms2.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15932 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
TestOwnerManagement.test_decline_invitation_removes_itstarter_packs/tests.py:605 self.assertFalse(self.pack.owners.filter(pk=self.friend.pk).exists())2 ms2.7%
QuerySet.existsdjango/db/models/query.py:14582 ms2.7%
Query.has_resultsdjango/db/models/sql/query.py:6872 ms2.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15932 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()2 ms2.7%
TestCase._fixture_teardowndjango/test/testcases.py:14982 ms2.7%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4952 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.7%
teardown0.60 ms0.7%
Estimated from 38 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
starter_packs/tests.py:602
response = self.client.post(reverse("decline_invitation", args=[self.pack.slug]))
TestOwnerManagement.test_decline_invitation_removes_it
· Libraries
|
59 ms |
|
starter_packs/tests.py:601
self.client.force_login(self.friend)
TestOwnerManagement.test_decline_invitation_removes_it
· Database
|
9 ms |
|
starter_packs/tests.py:600
StarterPackInvitation.objects.create(starter_pack=self.pack, invited_user=self.friend, invited_by=self.owner)
TestOwnerManagement.test_decline_invitation_removes_it
· Database
|
2 ms |
|
starter_packs/views.py:540
starter_pack = get_object_or_404(StarterPack, slug=starter_pack_slug, deleted_at__isnull=True)
decline_invitation
· Database
|
2 ms |
|
starter_packs/views.py:541
StarterPackInvitation.objects.filter(starter_pack=starter_pack, invited_user=request.user).delete()
decline_invitation
· Database
|
2 ms |
|
starter_packs/tests.py:604
self.assertFalse(self.pack.invitations.filter(invited_user=self.friend).exists())
TestOwnerManagement.test_decline_invitation_removes_it
· Database
|
2 ms |
|
starter_packs/tests.py:605
self.assertFalse(self.pack.owners.filter(pk=self.friend.pk).exists())
TestOwnerManagement.test_decline_invitation_removes_it
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.06 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
27 queries · 9 msNo repeated queries.
Biggest pieces of work
|
call test body
starter_packs/tests.py:602
|
79 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
2 ms |
| teardown pytest internals | 0.60 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 | 82 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 206 ms | Profile |
| 9 hours ago | CI github-actions:test | passed | 245 ms | Profile |
| 13 hours ago | CI github-actions:test | passed | 105 ms | Profile |
| 14 hours ago | CI github-actions:test | passed | 88 ms | Run |