Tests / accounts/tests.py
TestSelectedInstance::test_selected_instance
First seen 3 years ago in 1cd3a8d
CI
github-actions:test
13 runs
Average
160 ms
median 142 ms
max 341 ms
max 341 ms
Phases
Setup 1 ms
Call 158 ms
Teardown 0.55 ms
Categories
Database 21 ms
App code 0.20 ms
Other (Libraries, Templates, pytest, Unsampled, ...) 139 ms
13 database queries per run
Needs 672 KB of memory (max 920 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call103 ms99.0%
TestSelectedInstance.test_selected_instanceaccounts/tests.py:171 response = self.client.get("/?selected_instance=mastodon.social")69 ms66.0%
Client.getdjango/test/client.py:113369 ms66.0%
RequestFactory.getdjango/test/client.py:47569 ms66.0%
RequestFactory.genericdjango/test/client.py:67169 ms66.0%
Client.requestdjango/test/client.py:109169 ms66.0%
ClientHandler.__call__django/test/client.py:17337 ms35.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6337 ms35.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10437 ms35.6%
WhiteNoise.add_fileswhitenoise/base.py:10837 ms35.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12030 ms29.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13130 ms29.0%
WhiteNoise.get_static_filewhitenoise/base.py:21226 ms25.1%
WhiteNoise.add_cache_headerswhitenoise/base.py:23326 ms25.1%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:17626 ms25.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:19726 ms25.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:2026 ms25.1%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:23525 ms23.8%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:20725 ms23.8%
urldefrag<stdlib>/urllib/parse.py:77625 ms23.8%
_coerce_args<stdlib>/urllib/parse.py:13025 ms23.8%
WhiteNoise.get_static_filewhitenoise/base.py:2174 ms4.0%
StaticFile.__init__whitenoise/responders.py:733 ms2.6%
StaticFile.get_headerswhitenoise/responders.py:1781 ms1.3%
parsedate<stdlib>/email/_parseaddr.py:1851 ms1.3%
parsedate_tz<stdlib>/email/_parseaddr.py:501 ms1.3%
StaticFile.get_headerswhitenoise/responders.py:1761 ms1.3%
StaticFile.__init__whitenoise/responders.py:761 ms1.3%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1891 ms1.3%
Headers.__getitem__<stdlib>/wsgiref/headers.py:831 ms1.3%
Headers.get<stdlib>/wsgiref/headers.py:1071 ms1.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1157 ms6.6%
scantreewhitenoise/base.py:2717 ms6.6%
scantreewhitenoise/base.py:2714 ms4.0%
scantreewhitenoise/base.py:2713 ms2.6%
scantreewhitenoise/base.py:2713 ms2.6%
scantreewhitenoise/base.py:2713 ms2.6%
scantreewhitenoise/base.py:2733 ms2.6%
scantreewhitenoise/base.py:2731 ms1.3%
scantreewhitenoise/base.py:2731 ms1.3%
ClientHandler.__call__django/test/client.py:18632 ms30.4%
BaseHandler.get_responsedjango/core/handlers/base.py:14232 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5632 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38032 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5632 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38032 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5632 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38032 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5632 ms30.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12332 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5632 ms30.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14532 ms30.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5632 ms30.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38027 ms26.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5627 ms26.4%
BaseHandler._get_responsedjango/core/handlers/base.py:19927 ms26.4%
indexaccounts/views.py:425 return render(27 ms26.4%
renderdjango/shortcuts.py:2727 ms26.4%
render_to_stringdjango/template/loader.py:6227 ms26.4%
Template.renderdjango/template/backends/django.py:10727 ms26.4%
Template.renderdjango/template/base.py:17527 ms26.4%
instrumented_test_renderdjango/test/utils.py:11327 ms26.4%
NodeList.renderdjango/template/base.py:110827 ms26.4%
Node.render_annotateddjango/template/base.py:106927 ms26.4%
ExtendsNode.renderdjango/template/loader_tags.py:16027 ms26.4%
instrumented_test_renderdjango/test/utils.py:11327 ms26.4%
NodeList.renderdjango/template/base.py:110827 ms26.4%
Node.render_annotateddjango/template/base.py:106927 ms26.4%
BlockNode.renderdjango/template/loader_tags.py:6621 ms19.8%
NodeList.renderdjango/template/base.py:110821 ms19.8%
Node.render_annotateddjango/template/base.py:106921 ms19.8%
ForNode.renderdjango/template/defaulttags.py:24915 ms14.5%
Node.render_annotateddjango/template/base.py:106915 ms14.5%
IfNode.renderdjango/template/defaulttags.py:3265 ms5.3%
infix.<locals>.Operator.evaldjango/template/smartif.py:614 ms4.0%
<lambda>django/template/smartif.py:1063 ms2.6%
TemplateLiteral.evaldjango/template/defaulttags.py:9183 ms2.6%
FilterExpression.resolvedjango/template/base.py:8063 ms2.6%
Variable.resolvedjango/template/base.py:9453 ms2.6%
Variable._resolve_lookupdjango/template/base.py:9961 ms1.3%
<lambda>django/template/smartif.py:1071 ms1.3%
TemplateLiteral.evaldjango/template/defaulttags.py:9181 ms1.3%
FilterExpression.resolvedjango/template/base.py:8061 ms1.3%
Variable.resolvedjango/template/base.py:9451 ms1.3%
Variable._resolve_lookupdjango/template/base.py:-11 ms1.3%
StaticNode.renderdjango/templatetags/static.py:1165 ms5.3%
StaticNode.urldjango/templatetags/static.py:1135 ms5.3%
StaticNode.handle_simpledjango/templatetags/static.py:1293 ms2.6%
URLMixin.urldebug_toolbar/panels/staticfiles.py:201 ms1.3%
StaticNode.handle_simpledjango/templatetags/static.py:1271 ms1.3%
StaticNode.handle_simpledjango/templatetags/static.py:1261 ms1.3%
Variable._resolve_lookupdjango/template/base.py:-11 ms1.3%
IfNode.renderdjango/template/defaulttags.py:3331 ms1.3%
NodeList.renderdjango/template/base.py:11081 ms1.3%
Node.render_annotateddjango/template/base.py:10691 ms1.3%
URLNode.renderdjango/template/defaulttags.py:5111 ms1.3%
reversedjango/urls/base.py:981 ms1.3%
URLResolver._reverse_with_prefixdjango/urls/resolvers.py:7891 ms1.3%
VariableNode.renderdjango/template/base.py:11731 ms1.3%
render_value_in_contextdjango/template/base.py:11471 ms1.3%
IncludeNode.renderdjango/template/loader_tags.py:2113 ms2.6%
Template.renderdjango/template/base.py:1773 ms2.6%
instrumented_test_renderdjango/test/utils.py:1133 ms2.6%
NodeList.renderdjango/template/base.py:11083 ms2.6%
Node.render_annotateddjango/template/base.py:10693 ms2.6%
ForNode.renderdjango/template/defaulttags.py:2563 ms2.6%
SimpleNode.renderdjango/template/library.py:3431 ms1.3%
heroicon_outlineheroicons/templatetags/heroicons.py:231 ms1.3%
_render_iconheroicons/templatetags/heroicons.py:411 ms1.3%
_render_iconheroicons/__init__.py:651 ms1.3%
tostring<stdlib>/xml/etree/ElementTree.py:11061 ms1.3%
ElementTree.write<stdlib>/xml/etree/ElementTree.py:7451 ms1.3%
_namespaces<stdlib>/xml/etree/ElementTree.py:8441 ms1.3%
ForNode.renderdjango/template/defaulttags.py:2181 ms1.3%
Variable.resolvedjango/template/base.py:9451 ms1.3%
Variable._resolve_lookupdjango/template/base.py:10331 ms1.3%
IfNode.renderdjango/template/defaulttags.py:3333 ms2.6%
NodeList.renderdjango/template/base.py:11083 ms2.6%
Node.render_annotateddjango/template/base.py:10693 ms2.6%
VariableNode.renderdjango/template/base.py:11671 ms1.3%
FilterExpression.resolvedjango/template/base.py:8061 ms1.3%
Variable.resolvedjango/template/base.py:9451 ms1.3%
Variable._resolve_lookupdjango/template/base.py:9961 ms1.3%
IncludeNode.renderdjango/template/loader_tags.py:2111 ms1.3%
Template.renderdjango/template/base.py:1771 ms1.3%
instrumented_test_renderdjango/test/utils.py:1131 ms1.3%
NodeList.renderdjango/template/base.py:11081 ms1.3%
Node.render_annotateddjango/template/base.py:10691 ms1.3%
SimpleNode.renderdjango/template/library.py:3431 ms1.3%
instances_datalistaccounts/templatetags/account_extras.py:36 for instance in instances:1 ms1.3%
QuerySet.__iter__django/db/models/query.py:4391 ms1.3%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms1.3%
FlatValuesListIterable.__iter__django/db/models/query.py:3021 ms1.3%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15741 ms1.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms1.3%
CursorWrapper.executedjango/db/backends/utils.py:791 ms1.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms1.3%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms1.3%
Cursor.executepsycopg/cursor.py:1131 ms1.3%
Connection.waitpsycopg/connection.py:4951 ms1.3%
SimpleNode.renderdjango/template/library.py:3433 ms2.6%
heroicon_outlineheroicons/templatetags/heroicons.py:233 ms2.6%
_render_iconheroicons/templatetags/heroicons.py:413 ms2.6%
_render_iconheroicons/__init__.py:473 ms2.6%
deepcopy<stdlib>/copy.py:1373 ms2.6%
deepcopy<stdlib>/copy.py:1561 ms1.3%
CsrfTokenNode.renderdjango/template/defaulttags.py:781 ms1.3%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2511 ms1.3%
SimpleLazyObject._setupdjango/utils/functional.py:4041 ms1.3%
csrf.<locals>._get_valdjango/template/context_processors.py:261 ms1.3%
get_tokendjango/middleware/csrf.py:1131 ms1.3%
_add_new_csrf_cookiedjango/middleware/csrf.py:861 ms1.3%
_get_new_csrf_stringdjango/middleware/csrf.py:561 ms1.3%
get_random_stringdjango/utils/crypto.py:781 ms1.3%
get_random_string.<locals>.<genexpr>django/utils/crypto.py:781 ms1.3%
Random.choice<stdlib>/random.py:3541 ms1.3%
Random._randbelow_with_getrandbits<stdlib>/random.py:2491 ms1.3%
SystemRandom.getrandbits<stdlib>/random.py:9151 ms1.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3824 ms4.0%
SessionMiddleware.process_responsedjango/contrib/sessions/middleware.py:604 ms4.0%
SessionStore.savedjango/contrib/sessions/backends/db.py:1214 ms4.0%
SessionStore.createdjango/contrib/sessions/backends/db.py:744 ms4.0%
SessionStore.savedjango/contrib/sessions/backends/db.py:1274 ms4.0%
Model.savedjango/db/models/base.py:9044 ms4.0%
Model.save_basedjango/db/models/base.py:9964 ms4.0%
Model._save_tabledjango/db/models/base.py:11994 ms4.0%
Model._do_insertdjango/db/models/base.py:12514 ms4.0%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms4.0%
QuerySet._insertdjango/db/models/query.py:21414 ms4.0%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19364 ms4.0%
CursorWrapper.executedjango/db/backends/utils.py:794 ms4.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:924 ms4.0%
CursorWrapper._executedjango/db/backends/utils.py:1054 ms4.0%
Cursor.executepsycopg/cursor.py:1134 ms4.0%
Connection.waitpsycopg/connection.py:4954 ms4.0%
BaseCursor._execute_genpsycopg/_cursor_base.py:2064 ms4.0%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2864 ms4.0%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:784 ms4.0%
TransactionTestCase._pre_setupdjango/test/testcases.py:1167 cls._fixture_setup()32 ms30.4%
TestCase._fixture_setupdjango/test/testcases.py:148130 ms29.0%
TestCase._enter_atomicsdjango/test/testcases.py:139930 ms29.0%
Atomic.__enter__django/db/transaction.py:22330 ms29.0%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2630 ms29.0%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:40030 ms29.0%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:36730 ms29.0%
CursorWrapper.executedjango/db/backends/utils.py:7930 ms29.0%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9230 ms29.0%
CursorWrapper._executedjango/db/backends/utils.py:10330 ms29.0%
Cursor.executepsycopg/cursor.py:11330 ms29.0%
Connection.waitpsycopg/connection.py:49530 ms29.0%
BaseCursor._execute_genpsycopg/_cursor_base.py:20630 ms29.0%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28630 ms29.0%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7830 ms29.0%
TestCase._fixture_setupdjango/test/testcases.py:14731 ms1.3%
TestSelectedInstance.test_selected_instanceaccounts/tests.py:174 self.assertEqual(self.client.session["selected_instance"], "mastodon.social")1 ms1.3%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:551 ms1.3%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2541 ms1.3%
SessionStore.loaddjango/contrib/sessions/backends/db.py:551 ms1.3%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:341 ms1.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms1.3%
QuerySet.getdjango/db/models/query.py:7021 ms1.3%
QuerySet.__len__django/db/models/query.py:4211 ms1.3%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms1.3%
ModelIterable.__iter__django/db/models/query.py:1031 ms1.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16121 ms1.3%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7681 ms1.3%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:891 ms1.3%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:781 ms1.3%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3191 ms1.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5791 ms1.3%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()1 ms1.3%
TestCase._fixture_teardowndjango/test/testcases.py:14981 ms1.3%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4951 ms1.3%
CursorWrapper.executedjango/db/backends/utils.py:791 ms1.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms1.3%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms1.3%
Cursor.executepsycopg/cursor.py:1131 ms1.3%
Connection.waitpsycopg/connection.py:4951 ms1.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms1.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms1.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms1.3%
Estimated from 75 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
accounts/tests.py:171
response = self.client.get("/?selected_instance=mastodon.social")
TestSelectedInstance.test_selected_instance
· Libraries
|
41 ms |
|
accounts/views.py:425
return render(
index
· Templates
|
26 ms |
|
accounts/templatetags/account_extras.py:36
for instance in instances:
instances_datalist
· Database
|
1 ms |
|
accounts/tests.py:174
self.assertEqual(self.client.session["selected_instance"], "mastodon.social")
TestSelectedInstance.test_selected_instance
· Database
|
1 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.05 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_set_urlconf function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
13 queries · 8 msNo repeated queries.
Biggest pieces of work
|
call test body
accounts/tests.py:171
|
70 ms |
|
call _pre_setup
django/test/testcases.py:1167
|
32 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
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 | 104 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 137 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 184 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 73 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 128 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 179 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 102 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 142 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 179 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 81 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 162 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 264 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 341 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 125 ms | Run |