Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delay in test for deletion page #2855

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions listenbrainz/tests/integration/test_settings_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,18 @@ def test_delete_listens(self):
if not ok:
self.assertEqual(json.loads(resp.data)['payload']['count'], 0)

# check that the latest_import timestamp has been reset too
resp = self.client.get(self.custom_url_for('api_v1.latest_import', user_name=self.user['musicbrainz_id']))
self.assert200(resp)
self.assertEqual(resp.json['latest_import'], 0)
# wait for background tasks to be processed -- max 30s allowed for the test to pass
ok = False
for i in range(30):
time.sleep(1)

# check that the latest_import timestamp has been reset too
resp = self.client.get(self.custom_url_for('api_v1.latest_import', user_name=self.user['musicbrainz_id']))
self.assert200(resp)
if json.loads(resp.data)['latest_import'] == 0:
continue
else:
ok = True

if not ok:
self.assertEqual(resp.json['latest_import'], 0)
Loading