Tests / starter_packs/tests.py
TestPinAccountInStarterPack::test_readding_account_swaps_pin_button_to_enabled_unpinned
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
160 ms
median 136 ms
max 336 ms
max 336 ms
Phases
Setup 1 ms
Call 158 ms
Teardown 0.72 ms
Categories
Database 72 ms
Other (Libraries, Templates, pytest, Unsampled, ...) 88 ms
50 database queries per run
Needs 157 KB of memory (max 1 MB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call91 ms98.9%
TestPinAccountInStarterPack.test_readding_account_swaps_pin_button_to_enabled_unpinnedstarter_packs/tests.py:1116 self.client.post(toggle_url) # remove: drops the pin along with the membership row91 ms98.9%
Client.postdjango/test/client.py:116291 ms98.9%
RequestFactory.postdjango/test/client.py:49991 ms98.9%
RequestFactory.genericdjango/test/client.py:67191 ms98.9%
Client.requestdjango/test/client.py:109191 ms98.9%
ClientHandler.__call__django/test/client.py:17384 ms91.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6384 ms91.0%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10484 ms91.0%
WhiteNoise.add_fileswhitenoise/base.py:10884 ms91.0%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12083 ms90.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13183 ms90.0%
WhiteNoise.get_static_filewhitenoise/base.py:21781 ms88.0%
StaticFile.__init__whitenoise/responders.py:7763 ms68.0%
StaticFile.get_alternativeswhitenoise/responders.py:20161 ms66.0%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms2.0%
__init____init__:-12 ms2.0%
Headers.__init__<stdlib>/wsgiref/headers.py:432 ms2.0%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:482 ms2.0%
StaticFile.__init__whitenoise/responders.py:7318 ms20.0%
StaticFile.get_headerswhitenoise/responders.py:17617 ms18.0%
formatdate<stdlib>/email/utils.py:26616 ms17.0%
format_datetime<stdlib>/email/utils.py:27516 ms17.0%
StaticFile.get_headerswhitenoise/responders.py:1782 ms2.0%
parsedate<stdlib>/email/_parseaddr.py:1850.92 ms1.0%
WhiteNoise.get_static_filewhitenoise/base.py:2122 ms2.0%
WhiteNoise.add_cache_headerswhitenoise/base.py:2332 ms2.0%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms2.0%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1970.92 ms1.0%
URLMixin.urldebug_toolbar/panels/staticfiles.py:200.92 ms1.0%
ClientHandler.__call__django/test/client.py:1867 ms8.0%
BaseHandler.get_responsedjango/core/handlers/base.py:1427 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%
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%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:626 ms7.0%
toggle_account_to_starter_packstarter_packs/views.py:657 ).count()2 ms2.0%
QuerySet.countdjango/db/models/query.py:6772 ms2.0%
Query.get_countdjango/db/models/sql/query.py:6572 ms2.0%
Query.get_aggregationdjango/db/models/sql/query.py:6390.92 ms1.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.92 ms1.0%
CursorWrapper.executedjango/db/backends/utils.py:790.92 ms1.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.92 ms1.0%
CursorWrapper._executedjango/db/backends/utils.py:1050.92 ms1.0%
Cursor.executepsycopg/cursor.py:1130.92 ms1.0%
Connection.waitpsycopg/connection.py:4950.92 ms1.0%
Query.get_aggregationdjango/db/models/sql/query.py:6440.92 ms1.0%
toggle_account_to_starter_packstarter_packs/views.py:621 if StarterPackAccount.objects.filter(starter_pack=starter_pack, account_id=account_id).exists():0.92 ms1.0%
QuerySet.existsdjango/db/models/query.py:14580.92 ms1.0%
Query.has_resultsdjango/db/models/sql/query.py:6870.92 ms1.0%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15930.92 ms1.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16120.92 ms1.0%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7680.92 ms1.0%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:910.92 ms1.0%
toggle_account_to_starter_packstarter_packs/views.py:626 ).delete()0.92 ms1.0%
QuerySet.deletedjango/db/models/query.py:13570.92 ms1.0%
Collector.deletedjango/db/models/deletion.py:5020.92 ms1.0%
QuerySet._raw_deletedjango/db/models/query.py:13790.92 ms1.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.92 ms1.0%
CursorWrapper.executedjango/db/backends/utils.py:790.92 ms1.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.92 ms1.0%
CursorWrapper._executedjango/db/backends/utils.py:1050.92 ms1.0%
Cursor.executepsycopg/cursor.py:1130.92 ms1.0%
Connection.waitpsycopg/connection.py:4950.92 ms1.0%
toggle_account_to_starter_packstarter_packs/views.py:658 starter_pack.save(update_fields=["num_accounts"])0.92 ms1.0%
Model.savedjango/db/models/base.py:9040.92 ms1.0%
Model.save_basedjango/db/models/base.py:9960.92 ms1.0%
Model._save_tabledjango/db/models/base.py:11400.92 ms1.0%
Model._do_updatedjango/db/models/base.py:12440.92 ms1.0%
QuerySet._updatedjango/db/models/query.py:14480.92 ms1.0%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21500.92 ms1.0%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21210.92 ms1.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.92 ms1.0%
CursorWrapper.executedjango/db/backends/utils.py:790.92 ms1.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.92 ms1.0%
CursorWrapper._executedjango/db/backends/utils.py:1050.92 ms1.0%
Cursor.executepsycopg/cursor.py:1130.92 ms1.0%
Connection.waitpsycopg/connection.py:4950.92 ms1.0%
toggle_account_to_starter_packstarter_packs/views.py:6600.92 ms1.0%
get_splash_image_signaturestarter_packs/splash_images.py:880.92 ms1.0%
get_splash_image_accountsstarter_packs/splash_images.py:77 return list(accounts)0.92 ms1.0%
QuerySet.__iter__django/db/models/query.py:4390.92 ms1.0%
QuerySet._fetch_alldjango/db/models/query.py:22620.92 ms1.0%
ModelIterable.__iter__django/db/models/query.py:1030.92 ms1.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.92 ms1.0%
CursorWrapper.executedjango/db/backends/utils.py:790.92 ms1.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.92 ms1.0%
CursorWrapper._executedjango/db/backends/utils.py:1050.92 ms1.0%
Cursor.executepsycopg/cursor.py:1130.92 ms1.0%
Connection.waitpsycopg/connection.py:4950.92 ms1.0%
toggle_account_to_starter_packstarter_packs/views.py:674 "num_accounts": StarterPackAccount.objects.filter(starter_pack=starter_pack).count(),0.92 ms1.0%
QuerySet.countdjango/db/models/query.py:6770.92 ms1.0%
Query.get_countdjango/db/models/sql/query.py:6570.92 ms1.0%
Query.get_aggregationdjango/db/models/sql/query.py:6390.92 ms1.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.92 ms1.0%
CursorWrapper.executedjango/db/backends/utils.py:790.92 ms1.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.92 ms1.0%
CursorWrapper._executedjango/db/backends/utils.py:1050.92 ms1.0%
Cursor.executepsycopg/cursor.py:1130.92 ms1.0%
Connection.waitpsycopg/connection.py:4950.92 ms1.0%
Atomic.__enter__django/db/transaction.py:2230.92 ms1.0%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:260.92 ms1.0%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4000.92 ms1.0%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3670.92 ms1.0%
CursorWrapper.executedjango/db/backends/utils.py:790.92 ms1.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.92 ms1.0%
CursorWrapper._executedjango/db/backends/utils.py:1030.92 ms1.0%
Cursor.executepsycopg/cursor.py:1130.92 ms1.0%
Connection.waitpsycopg/connection.py:4950.92 ms1.0%
BaseCursor._execute_genpsycopg/_cursor_base.py:2060.92 ms1.0%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2860.92 ms1.0%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:780.92 ms1.0%
Estimated from 99 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
starter_packs/tests.py:1116
self.client.post(toggle_url) # remove: drops the pin along with the membership row
TestPinAccountInStarterPack.test_readding_account_swaps_pin_button_to_enabled_unpinned
· Libraries
|
85 ms |
|
starter_packs/views.py:657
).count()
toggle_account_to_starter_pack
· Database
|
2 ms |
|
starter_packs/views.py:621
if StarterPackAccount.objects.filter(starter_pack=starter_pack, account_id=account_id).exists():
toggle_account_to_starter_pack
· Database
|
0.92 ms |
|
starter_packs/views.py:626
).delete()
toggle_account_to_starter_pack
· Database
|
0.92 ms |
|
starter_packs/views.py:658
starter_pack.save(update_fields=["num_accounts"])
toggle_account_to_starter_pack
· Database
|
0.92 ms |
|
starter_packs/splash_images.py:77
return list(accounts)
get_splash_image_accounts
· Database
|
0.92 ms |
|
starter_packs/views.py:674
"num_accounts": StarterPackAccount.objects.filter(starter_pack=starter_pack).count(),
toggle_account_to_starter_pack
· Database
|
0.92 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.04 ms |
| _django_db_marker function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
50 queries · 17 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
4×
SELECT "starter_packs_starterpack"."id", "starter_packs_starterpack"."title", "starter_packs_starterpack"."slug", "starter_packs_starterpack"."description", "starter_packs_starterpack"."languages", "starter_packs_starterpack"."created_by_id", "starter_packs_starterpack"."created_at", "starter_packs…
4×
SELECT "accounts_account"."id", "accounts_account"."account_id", "accounts_account"."instance", "accounts_account"."instance_model_id", "accounts_account"."username_at_instance", "accounts_account"."search", "accounts_account"."username", "accounts_account"."acct", "accounts_account"."display_name"…
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 ?
3×
SELECT COUNT(*) AS "__count" FROM "starter_packs_starterpackaccount" WHERE "starter_packs_starterpackaccount"."starter_pack_id" = %s
Biggest pieces of work
|
call test body
starter_packs/tests.py:1116
|
91 ms |
Reliability
14 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 14 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 92 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 214 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 136 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 105 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 149 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 112 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 103 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 146 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 130 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 96 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 280 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 176 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 336 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 103 ms | Run |