Skip to content

Commit f2d8cca

Browse files
committed
/web-site: add poll-feed task
for #1202
1 parent ec556e9 commit f2d8cca

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/test_web.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2778,7 +2778,10 @@ def test_id_as(self, *_):
27782778
self.assertEqual('https://fed.brid.gy/user.com',
27792779
self.user.id_as(ActivityPub))
27802780

2781-
def test_check_web_site(self, mock_get, _):
2781+
@patch('oauth_dropins.webutil.appengine_config.tasks_client.create_task')
2782+
def test_check_web_site(self, mock_create_task, mock_get, _):
2783+
common.RUN_TASKS_INLINE = False
2784+
27822785
redir = 'http://localhost/.well-known/webfinger?resource=acct:[email protected]'
27832786
mock_get.side_effect = (
27842787
requests_response('', status=302, redirected_url=redir),
@@ -2793,6 +2796,8 @@ def test_check_web_site(self, mock_get, _):
27932796
self.assertTrue(user.has_hcard)
27942797
self.assertEqual('person', user.obj.as1['objectType'])
27952798

2799+
self.assert_task(mock_create_task, 'poll-feed', domain='user.com')
2800+
27962801
def test_check_web_site_unicode_domain(self, mock_get, _):
27972802
mock_get.side_effect = (
27982803
requests_response(''),

web.py

+1
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ def check_web_site():
677677
flash(f'{url} looks like a fediverse server! Try a normal web site.')
678678
return render_template('enter_web_site.html'), 400
679679

680+
common.create_task(queue='poll-feed', domain=domain)
680681
return redirect(user.user_page_path())
681682

682683

0 commit comments

Comments
 (0)