@@ -127,7 +127,7 @@ def test_fake_to_other_no_copy(self):
127
127
self .assertEqual (404 , resp .status_code )
128
128
129
129
@patch .object (Fake , 'HAS_COPIES' , new = False )
130
- def test_fake_to_other_user_not_enabled (self ):
130
+ def test_eefake_to_other_user_not_enabled (self ):
131
131
"""https://github.com/snarfed/bridgy-fed/issues/1248"""
132
132
self .make_user ('eefake:user' , cls = ExplicitEnableFake , enabled_protocols = [])
133
133
self .store_object (id = 'eefake:post' , our_as1 = {'author' : 'eefake:user' },
@@ -137,7 +137,7 @@ def test_fake_to_other_user_not_enabled(self):
137
137
base_url = 'https://eefake.brid.gy/' )
138
138
self .assertEqual (404 , resp .status_code )
139
139
140
- def test_fake_to_other_repost_original_post_no_copy (self ):
140
+ def test_eefake_to_other_repost_original_post_no_copy (self ):
141
141
"""https://github.com/snarfed/bridgy-fed/issues/1248"""
142
142
self .make_user ('eefake:user' , cls = ExplicitEnableFake ,
143
143
enabled_protocols = ['other' ])
@@ -153,12 +153,12 @@ def test_fake_to_other_repost_original_post_no_copy(self):
153
153
'actor' : 'eefake:user' ,
154
154
})
155
155
156
- resp = self .client .get (f'/convert/other/fake :repost' ,
157
- base_url = 'https://fa .brid.gy/' )
156
+ resp = self .client .get (f'/convert/other/eefake :repost' ,
157
+ base_url = 'https://eefake .brid.gy/' )
158
158
self .assertEqual (404 , resp .status_code )
159
159
160
160
@patch .object (Fake , 'HAS_COPIES' , new = False )
161
- def test_fake_to_other_repost_original_author_not_enabled (self ):
161
+ def test_eefake_to_other_repost_original_author_not_enabled (self ):
162
162
"""https://github.com/snarfed/bridgy-fed/issues/1248"""
163
163
self .make_user ('eefake:user' , cls = ExplicitEnableFake ,
164
164
enabled_protocols = ['other' ])
@@ -173,6 +173,24 @@ def test_fake_to_other_repost_original_author_not_enabled(self):
173
173
'actor' : 'eefake:user' ,
174
174
})
175
175
176
+ resp = self .client .get (f'/convert/other/eefake:repost' ,
177
+ base_url = 'https://eefake.brid.gy/' )
178
+ self .assertEqual (404 , resp .status_code )
179
+
180
+ @patch .object (Fake , 'HAS_COPIES' , new = False )
181
+ def test_fake_to_other_repost_of_eefake_original_author_not_enabled (self ):
182
+ self .make_user ('fake:user' , cls = Fake , enabled_protocols = ['other' ])
183
+ self .make_user ('eefake:orig-user' , cls = ExplicitEnableFake ,
184
+ enabled_protocols = ['fake' ]) # not other
185
+
186
+ self .store_object (id = 'eefake:post' , our_as1 = {'author' : 'eefake:orig-user' })
187
+ self .store_object (id = 'fake:repost' , our_as1 = {
188
+ 'objectType' : 'activity' ,
189
+ 'verb' : 'share' ,
190
+ 'object' : 'eefake:post' ,
191
+ 'actor' : 'fake:user' ,
192
+ })
193
+
176
194
resp = self .client .get (f'/convert/other/fake:repost' ,
177
195
base_url = 'https://fa.brid.gy/' )
178
196
self .assertEqual (404 , resp .status_code )
@@ -385,6 +403,7 @@ def test_web_to_activitypub_no_user(self, mock_get):
385
403
hcard ,
386
404
hcard ,
387
405
hcard ,
406
+ requests_response (status = 404 ), # webfinger for protocol inference
388
407
requests_response ('<html></html>' ), # user for is_enabled protocol check
389
408
]
390
409
0 commit comments