Tests / starter_packs/tests.py
TestShareStarterPack::test_logged_in
First seen 2 years ago in 1b5db0c
CI
github-actions:test
13 runs
Average
206 ms
median 185 ms
max 345 ms
max 345 ms
Phases
Setup 8 ms
Call 197 ms
Teardown 0.37 ms
Categories
Database 80 ms
Factories 1 ms
App code 0.42 ms
Test code 0.16 ms
Other (Libraries, Templates, pytest, Unsampled, ...) 124 ms
38 database queries per run
Needs 572 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
setup1 ms0.5%
_live_server_helperpytest_django/fixtures.py:656 if "live_server" not in request.fixturenames:1 ms0.5%
call267 ms99.4%
TestShareStarterPack.test_logged_instarter_packs/tests.py:709 response = self.client.get(reverse("share_starter_pack", args=[self.starter_pack.slug]))226 ms84.0%
Client.getdjango/test/client.py:1133226 ms84.0%
RequestFactory.getdjango/test/client.py:475226 ms84.0%
RequestFactory.genericdjango/test/client.py:671226 ms84.0%
Client.requestdjango/test/client.py:1091226 ms84.0%
ClientHandler.__call__django/test/client.py:173225 ms83.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:63225 ms83.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:104225 ms83.6%
WhiteNoise.add_fileswhitenoise/base.py:108225 ms83.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:120218 ms81.2%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:131218 ms81.2%
WhiteNoise.get_static_filewhitenoise/base.py:217202 ms75.1%
StaticFile.__init__whitenoise/responders.py:77186 ms69.1%
StaticFile.get_alternativeswhitenoise/responders.py:204178 ms66.3%
compile<stdlib>/re/__init__.py:289178 ms66.3%
<GC>~178 ms66.3%
StaticFile.get_alternativeswhitenoise/responders.py:2003 ms1.2%
__init____init__:-12 ms0.8%
Headers.__init__<stdlib>/wsgiref/headers.py:442 ms0.8%
1 smaller frames hidden
3 smaller frames hidden
StaticFile.__init__whitenoise/responders.py:737 ms2.4%
StaticFile.get_headerswhitenoise/responders.py:1764 ms1.6%
formatdate<stdlib>/email/utils.py:2592 ms0.8%
2 smaller frames hidden
2 smaller frames hidden
StaticFile.__init__whitenoise/responders.py:743 ms1.2%
parsedate<stdlib>/email/_parseaddr.py:1852 ms0.8%
parsedate_tz<stdlib>/email/_parseaddr.py:502 ms0.8%
_parsedate_tz<stdlib>/email/_parseaddr.py:962 ms0.8%
1 smaller frames hidden
StaticFile.__init__whitenoise/responders.py:723 ms1.2%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms0.8%
__init____init__:-12 ms0.8%
1 smaller frames hidden
StaticFile.__init__whitenoise/responders.py:752 ms0.8%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms0.8%
Headers.get<stdlib>/wsgiref/headers.py:1042 ms0.8%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms0.8%
1 smaller frames hidden
WhiteNoise.get_static_filewhitenoise/base.py:21214 ms5.3%
WhiteNoise.add_cache_headerswhitenoise/base.py:23314 ms5.3%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:17613 ms4.8%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:19713 ms4.8%
URLMixin.urldebug_toolbar/panels/staticfiles.py:218 ms2.8%
<GC>~8 ms2.8%
URLMixin.urldebug_toolbar/panels/staticfiles.py:204 ms1.6%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2354 ms1.6%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2162 ms0.8%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2072 ms0.8%
2 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
2 smaller frames hidden
WhiteNoise.update_files_dictionarywhitenoise/base.py:1157 ms2.4%
scantreewhitenoise/base.py:2715 ms2.0%
scantreewhitenoise/base.py:2715 ms2.0%
scantreewhitenoise/base.py:2733 ms1.2%
scantreewhitenoise/base.py:2712 ms0.8%
scantreewhitenoise/base.py:2712 ms0.8%
1 smaller frames hidden
TestShareStarterPack.test_logged_instarter_packs/tests.py:716 self.assertContains(response, account.account.username)22 ms8.1%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:26622 ms8.1%
FetchOne.fetchdjango/db/models/fetch_modes.py:1722 ms8.1%
ForwardManyToOneDescriptor.fetch_onedjango/db/models/fields/related_descriptors.py:27922 ms8.1%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:23122 ms8.1%
QuerySet.getdjango/db/models/query.py:70221 ms7.7%
QuerySet.__len__django/db/models/query.py:42121 ms7.7%
QuerySet._fetch_alldjango/db/models/query.py:226221 ms7.7%
ModelIterable.__iter__django/db/models/query.py:10321 ms7.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162520 ms7.3%
CursorWrapper.executedjango/db/backends/utils.py:7920 ms7.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9220 ms7.3%
CursorWrapper._executedjango/db/backends/utils.py:10520 ms7.3%
Cursor.executepsycopg/cursor.py:11320 ms7.3%
Connection.waitpsycopg/connection.py:49520 ms7.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:20620 ms7.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28620 ms7.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7820 ms7.3%
1 smaller frames hidden
1 smaller frames hidden
TestShareStarterPack.test_logged_instarter_packs/tests.py:714 for account in self.starter_pack.starterpackaccount_set.all():11 ms4.0%
QuerySet.__iter__django/db/models/query.py:43911 ms4.0%
QuerySet._fetch_alldjango/db/models/query.py:226211 ms4.0%
ModelIterable.__iter__django/db/models/query.py:10310 ms3.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16259 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:799 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:929 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1059 ms3.2%
Cursor.executepsycopg/cursor.py:1139 ms3.2%
Connection.waitpsycopg/connection.py:4959 ms3.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2069 ms3.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2869 ms3.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:789 ms3.2%
1 smaller frames hidden
1 smaller frames hidden
TestShareStarterPack.test_logged_instarter_packs/tests.py:708 self.client.force_login(self.user)5 ms2.0%
ClientMixin.force_logindjango/test/client.py:8585 ms2.0%
ClientMixin._logindjango/test/client.py:8893 ms1.2%
ClientMixin._logindjango/test/client.py:8842 ms0.8%
ClientMixin.sessiondjango/test/client.py:8152 ms0.8%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms0.8%
2 smaller frames hidden
Estimated from 249 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
starter_packs/tests.py:709
response = self.client.get(reverse("share_starter_pack", args=[self.starter_pack.slug]))
TestShareStarterPack.test_logged_in
· Libraries
|
225 ms |
|
starter_packs/tests.py:716
self.assertContains(response, account.account.username)
TestShareStarterPack.test_logged_in
· Database
|
22 ms |
|
starter_packs/tests.py:714
for account in self.starter_pack.starterpackaccount_set.all():
TestShareStarterPack.test_logged_in
· Database
|
11 ms |
|
starter_packs/tests.py:708
self.client.force_login(self.user)
TestShareStarterPack.test_logged_in
· Database
|
5 ms |
|
starter_packs/views.py:871
"page_image": starter_pack.splash_image.url if starter_pack.splash_image else static("og-starterpack.png"),
share_starter_pack
· Libraries
|
1 ms |
|
starter_packs/tests.py:715
with self.subTest("Check account"):
TestShareStarterPack.test_logged_in
· pytest
|
1 ms |
|
starter_packs/tests.py:718
self.assertContains(response, "Edit")
TestShareStarterPack.test_logged_in
· Libraries
|
1 ms |
Fixtures
Exact setup time| _live_server_helper function | 0.74 ms |
| _template_string_if_invalid_marker function | 0.05 ms |
| _dj_autoclear_mailbox function | 0.04 ms |
| monkeypatch function | 0.03 ms |
| _django_db_marker function | 0.02 ms |
| _django_isolate_apps function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| _django_set_urlconf function | 0.02 ms |
Database
36 queries · 19 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
7×
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"…
Biggest pieces of work
|
call test body
starter_packs/tests.py:709
|
266 ms |
|
setup fixture _live_server_helper
pytest_django/fixtures.py:656
|
1 ms |
| call pytest internals | 1 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 | 269 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 185 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 158 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 97 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 197 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 345 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 117 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 155 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 155 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 118 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 271 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 314 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 298 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 296 ms | Run |