starter_packs/tests.py::TestShareStarterPack::test_api_plain_json
Failure details
self = <starter_packs.tests.TestShareStarterPack testMethod=test_api_plain_json>
def test_api_plain_json(self):
# Testing the plain JSON response
url = reverse("share_starter_pack", args=[self.starter_pack.slug])
response = self.client.get(
url,
headers={"accept": "application/json"},
)
payload = response.json()
accounts = (
Account.objects.filter(
starterpackaccount__starter_pack=self.starter_pack,
instance_model__isnull=False,
instance_model__deleted_at__isnull=True,
discoverable=True,
)
.select_related("accountlookup", "instance_model")
.order_by("-followers_count")
)
> self.assertEqual(
payload,
{
"url": f"http://testserver{url}",
"title": self.starter_pack.title,
"description": self.starter_pack.description,
"created_by": self.starter_pack.created_by.username,
"created_at": self.starter_pack.created_at.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z",
"updated_at": self.starter_pack.updated_at.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z",
"published_at": self.starter_pack.published_at,
"daily_follows": self.starter_pack.daily_follows,
"weekly_follows": self.starter_pack.weekly_follows,
"monthly_follows": self.starter_pack.monthly_follows,
"accounts": [
{
"name": account.name,
"handle": account.username_at_instance,
"url": account.url,
"activitypub_id": account.activitypub_id,
"created_at": account.created_at.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z",
"followers_count": account.followers_count,
"following_count": account.following_count,
"statuses_count": account.statuses_count,
"bot": account.bot,
"discoverable": account.discoverable,
"locked": account.locked,
"noindex": account.noindex,
"avatar": account.avatar,
"header": account.avatar,
}
for account in accounts
],
},
)
E AssertionError: {'url[4741 chars]53:44Z', 'followers_count': -2018463948, 'foll[241 chars]/'}]} != {'url[4741 chars]53:44.000Z', 'followers_count': -2018463948, '[245 chars]/'}]}
E Diff is 6356 characters long. Set self.maxDiff to None to see it.
starter_packs/tests.py:866: AssertionError
|
Fail
|
268 ms |
|
confs/tests.py::TestEditConference::test_owner_can_edit
|
Pass
|
3.45 s |
|
confs/tests.py::TestEditConference::test_other_user_forbidden_on_approved_conference
|
Pass
|
3.18 s |
|
confs/tests.py::TestEditConference::test_edit_does_not_change_slug
|
Pass
|
3.11 s |
|
confs/tests.py::TestConferenceOgImage::test_management_command_renders_missing_and_skips_current
|
Pass
|
2.86 s |
|
confs/tests.py::TestEditConference::test_other_user_forbidden
|
Pass
|
2.64 s |
|
confs/tests.py::TestLegacyConferenceDataMigration::test_copies_overlapping_legacy_rows_without_clobbering_existing_data
|
Pass
|
2.42 s |
|
confs/tests.py::TestApproveConference::test_staff_sees_approve_button_on_detail
|
Pass
|
2.25 s |
|
confs/tests.py::TestConferenceApprovalVisibility::test_other_user_does_not_see_pending
|
Pass
|
2.21 s |
|
confs/tests.py::TestApproveConference::test_anonymous_sees_pending_banner_without_button
|
Pass
|
2.18 s |
|
confs/tests.py::TestEditConference::test_owner_can_edit_after_approval
|
Pass
|
2.15 s |
|
fedidevs/tests.py::TestAnonymousCacheAndCsrf::test_authenticated_html_is_private_and_keeps_csrf_header
|
Pass
|
2.12 s |
|
confs/tests.py::TestLegacyConferenceDataMigration::test_drops_legacy_tables_when_uniques_are_mysql_style_indexes
|
Pass
|
2.04 s |
|
confs/tests.py::TestApproveConference::test_anonymous_redirected_to_login
|
Pass
|
2.03 s |
|
confs/tests.py::TestConferenceApprovalVisibility::test_owner_sees_own_pending
|
Pass
|
2.02 s |
|
confs/tests.py::TestApproveConference::test_non_staff_forbidden
|
Pass
|
2.02 s |
|
confs/tests.py::TestApproveConference::test_get_not_allowed
|
Pass
|
1.90 s |
|
confs/tests.py::TestApproveConference::test_staff_approves
|
Pass
|
1.73 s |
|
confs/tests.py::TestConferenceApprovalVisibility::test_pending_detail_page_is_viewable
|
Pass
|
1.70 s |
|
starter_packs/tests.py::TestToggleStarterPackAccount::test_toggle_after_limit
|
Pass
|
1.66 s |
|
confs/tests.py::TestCreateConference::test_mastodon_url_is_kept
|
Pass
|
1.63 s |
|
confs/tests.py::TestCreateConference::test_rejects_more_than_three_icons
|
Pass
|
1.32 s |
|
confs/tests.py::TestCreateConference::test_rejects_end_date_before_start
|
Pass
|
1.25 s |
|
confs/tests.py::TestCreateConference::test_submit_creates_pending_conference
|
Pass
|
1.18 s |
|
confs/tests.py::TestCreateConference::test_mastodon_handle_is_converted_to_url
|
Pass
|
1.12 s |
|
confs/tests.py::TestEditConference::test_owner_can_view_edit_form
|
Pass
|
1.11 s |
|
confs/tests.py::TestCreateConference::test_advanced_days_are_saved
|
Pass
|
1.07 s |
|
confs/tests.py::TestCreateConference::test_slug_collision_is_resolved
|
Pass
|
1.04 s |
|
confs/tests.py::TestCreateConference::test_requires_login
|
Pass
|
1.03 s |
|
confs/tests.py::TestCreateConference::test_selected_icons_are_saved
|
Pass
|
1.02 s |
|
confs/tests.py::TestEditConference::test_owner_sees_edit_button_on_approved_detail
|
Pass
|
980 ms |
|
confs/tests.py::TestEditConference::test_staff_can_edit
|
Pass
|
959 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_sort_select_avoids_inline_js
|
Pass
|
938 ms |
|
confs/tests.py::TestEditConference::test_requires_login
|
Pass
|
915 ms |
|
confs/tests.py::TestCreateConference::test_form_renders_for_authenticated_user
|
Pass
|
814 ms |
|
confs/tests.py::TestConferencePage::test_conference_with_pacific_with_date
|
Pass
|
678 ms |
|
confs/tests.py::TestUnapproveConference::test_staff_unapproves
|
Pass
|
669 ms |
|
accounts/tests.py::TestStaticPages::test_developers_on_mastodon
|
Pass
|
665 ms |
|
confs/tests.py::TestUnapproveConference::test_non_staff_forbidden
|
Pass
|
663 ms |
|
confs/tests.py::TestConferenceApprovalVisibility::test_anonymous_sees_only_approved
|
Pass
|
659 ms |
|
confs/tests.py::TestConferenceApprovalVisibility::test_conference_tag_icon_rendered_in_list
|
Pass
|
650 ms |
|
confs/tests.py::TestMigratedLegacyConferences::test_djangoconafrica_page
|
Pass
|
634 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_non_discoverable_accounts
|
Pass
|
616 ms |
|
accounts/tests.py::TestAccountIndexRobots::test_single_facet_is_indexable
|
Pass
|
600 ms |
|
starter_packs/tests.py::TestEditStarterPack::test_not_owned_starter_pack
|
Pass
|
590 ms |
|
starter_packs/tests.py::TestStarterPacks::test_index_page_language_filter
|
Pass
|
576 ms |
|
accounts/tests.py::TestSelectedInstance::test_invalid_selected_instance
|
Pass
|
533 ms |
|
confs/tests.py::TestConferenceOgImage::test_render_writes_file_and_updates_fields
|
Pass
|
462 ms |
|
confs/tests.py::TestConferencePage::test_conference_with_utc_with_date_no_posts
|
Pass
|
431 ms |
|
confs/tests.py::TestMigratedLegacyConferences::test_dotnetconf_page
|
Pass
|
429 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_invite_blocked_when_owners_plus_invitations_at_max
|
Pass
|
401 ms |
|
accounts/tests.py::TestInstanceIndexingBridgy::test_follows_redirect_and_coerces_null_version
|
Pass
|
394 ms |
|
fedidevs/tests.py::TestAnonymousCacheAndCsrf::test_anonymous_forms_work_after_csrf_bootstrap
|
Pass
|
394 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_accept_blocked_when_pack_at_max
|
Pass
|
378 ms |
|
starter_packs/tests.py::TestRemoteFollowStarterPack::test_error_on_invalid_handle
|
Pass
|
376 ms |
|
confs/tests.py::TestMigratedLegacyConferences::test_djangoconus_old_url_redirects
|
Pass
|
363 ms |
|
starter_packs/tests.py::TestCreateStarterPack::test_create_starter_pack
|
Pass
|
359 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_invite_blocked_at_max
|
Pass
|
337 ms |
|
starter_packs/tests.py::TestRemoteFollowStarterPack::test_error_when_no_subscribe_endpoint
|
Pass
|
328 ms |
|
confs/tests.py::TestMigratedLegacyConferences::test_migrated_conference_shows_linked_posts
|
Pass
|
319 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_logged_in
|
Pass
|
310 ms |
|
accounts/tests.py::TestAccountIndexRobots::test_canonical_page_is_indexable
|
Pass
|
309 ms |
|
starter_packs/tests.py::TestCreateStarterPack::test_create_page_logged_in
|
Pass
|
308 ms |
|
starter_packs/tests.py::TestEditStarterPackAccounts::test_edit_starter_packs
|
Pass
|
305 ms |
|
starter_packs/tests.py::TestStarterPacks::test_index_page_with_own_starter_packs
|
Pass
|
303 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_order_by_1___followers____4__3__2__1__0__
|
Pass
|
303 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_invite_existing_owner_is_noop
|
Pass
|
303 ms |
|
starter_packs/tests.py::TestCreateStarterPack::test_create_starter_pack_rejects_unknown_language
|
Pass
|
300 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_invite_creates_pending_invitation_not_owner
|
Pass
|
297 ms |
|
starter_packs/tests.py::TestStarterPacks::test_index_page_unknown_language_ignored
|
Pass
|
296 ms |
|
starter_packs/tests.py::TestStarterPacks::test_index_page_logged_in
|
Pass
|
293 ms |
|
starter_packs/tests.py::TestCreateStarterPack::test_create_starter_pack_rejects_too_many_languages
|
Pass
|
291 ms |
|
confs/tests.py::TestConferencesPage::test_conferences_page
|
Pass
|
288 ms |
|
starter_packs/tests.py::TestEditStarterPack::test_edit_starter_pack_post
|
Pass
|
286 ms |
|
confs/tests.py::TestConferencePage::test_conference_utc_with_no_filter
|
Pass
|
286 ms |
|
accounts/tests.py::TestSelectedInstance::test_selected_instance_http_truncate
|
Pass
|
285 ms |
|
accounts/tests.py::TestAccountIndexRobots::test_empty_facet_values_are_not_facets
|
Pass
|
282 ms |
|
starter_packs/tests.py::TestEditStarterPack::test_edit_shows_selected_uncommon_language_expanded
|
Pass
|
281 ms |
|
starter_packs/tests.py::TestFollowStarterPack::test_success
|
Pass
|
280 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_invite_twice_does_not_duplicate
|
Pass
|
280 ms |
|
starter_packs/tests.py::TestCreateStarterPack::test_create_starter_pack_defaults_to_no_languages
|
Pass
|
277 ms |
|
starter_packs/tests.py::TestToggleStarterPackAccount::test_remove_account
|
Pass
|
275 ms |
|
starter_packs/tests.py::TestEditStarterPackAccounts::test_not_owned_starter_pack
|
Pass
|
273 ms |
|
accounts/tests.py::TestSitemap::test_sitemap
|
Pass
|
271 ms |
|
fedidevs/tests.py::TestAnonymousCacheAndCsrf::test_other_pages_keep_unknown_query_params
|
Pass
|
269 ms |
|
accounts/tests.py::TestSelectedInstance::test_unselected_instance
|
Pass
|
268 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_languages_shown_when_set
|
Pass
|
268 ms |
|
accounts/tests.py::TestSelectedInstance::test_selected_instance_through_session
|
Pass
|
266 ms |
|
stats/tests.py::TestStats::test_posts_from_yesterday_are_updated
|
Pass
|
265 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_order_by_4___newest_account____0__1__2__3__4__
|
Pass
|
265 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_order_by_htmx_swaps_account_list
|
Pass
|
263 ms |
|
starter_packs/tests.py::TestCreateStarterPack::test_create_page
|
Pass
|
262 ms |
|
starter_packs/tests.py::TestPinAccountInStarterPack::test_no_pin_button_on_share_page
|
Pass
|
262 ms |
|
accounts/tests.py::TestSelectedInstance::test_selected_instance
|
Pass
|
262 ms |
|
starter_packs/tests.py::TestStarterPacks::test_index_page
|
Pass
|
261 ms |
|
confs/tests.py::TestMigratedLegacyConferences::test_fwd50_date_redirects
|
Pass
|
260 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_order_by_5___alphabetical____4__3__2__1__0__
|
Pass
|
260 ms |
|
confs/tests.py::TestConferencePage::test_posts_after_filter_does_not_warn_naive_datetime
|
Pass
|
259 ms |
|
starter_packs/tests.py::TestShareStarterPack::test_api_formats_6___text_html____text_html__
|
Pass
|
259 ms |
|
starter_packs/tests.py::TestOwnerManagement::test_search_excludes_existing_owners
|
Pass
|
259 ms |