@@ -39,7 +39,6 @@ def setUp(self):
3939 'https://foo.com/about-me' ,
4040 'https://foo.com/' ,
4141 ],
42- 'magic_keys' : [{'value' : self .key .href ()}],
4342 'links' : [{
4443 'rel' : 'http://webfinger.net/rel/profile-page' ,
4544 'type' : 'text/html' ,
@@ -67,20 +66,10 @@ def setUp(self):
6766 'rel' : 'sharedInbox' ,
6867 'type' : 'application/activity+json' ,
6968 'href' : 'http://localhost/inbox'
70- }, {
71- 'rel' : 'magic-public-key' ,
72- 'href' : self .key .href (),
7369 }, {
7470 'rel' : 'http://ostatus.org/schema/1.0/subscribe' ,
7571 'template' : 'http://localhost/user/foo.com?url={uri}' ,
76- }, {
77- 'rel' : 'http://schemas.google.com/g/2010#updates-from' ,
78- 'type' : 'application/atom+xml' ,
79- 'href' : 'https://granary.io/url?input=html&output=atom&url=https%3A%2F%2Ffoo.com%2F&hub=https%3A%2F%2Ffoo.com%2F' ,
80- }, {
81- 'rel' : 'hub' ,
82- 'href' : 'https://bridgy-fed.superfeedr.com/'
83- }]
72+ }],
8473 }
8574
8675 def test_host_meta_xrd (self ):
@@ -116,50 +105,6 @@ def test_user(self, mock_get):
116105
117106 self .assertEqual (self .expected_webfinger , got .json )
118107
119- # check that magic key is persistent
120- again = self .client .get ('/acct:foo.com' ,
121- headers = {'Accept' : 'application/json' }).json
122- self .assertEqual (self .key .href (), again ['magic_keys' ][0 ]['value' ])
123-
124- links = {l ['rel' ]: l .get ('href' ) for l in again ['links' ]}
125- self .assertEqual (self .key .href (), links ['magic-public-key' ])
126-
127- @mock .patch ('requests.get' )
128- def test_user_with_atom_feed (self , mock_get ):
129- html = """\
130- <html>
131- <head>
132- <link rel="feed" href="/dont-use">
133- <link rel="alternate" type="application/rss+xml" href="/dont-use-either">
134- <link rel="alternate" type="application/atom+xml" href="/use-this">
135- </head>
136- """ + self .html
137- mock_get .return_value = requests_response (html , url = 'https://foo.com/' )
138-
139- got = self .client .get ('/acct:foo.com' , headers = {'Accept' : 'application/json' })
140- self .assertEqual (200 , got .status_code )
141- self .assertIn ({
142- 'rel' : 'http://schemas.google.com/g/2010#updates-from' ,
143- 'type' : 'application/atom+xml' ,
144- 'href' : 'https://foo.com/use-this' ,
145- }, got .json ['links' ])
146-
147- @mock .patch ('requests.get' )
148- def test_user_with_push_header (self , mock_get ):
149- mock_get .return_value = requests_response (
150- self .html , url = 'https://foo.com/' , headers = {
151- 'Link' : 'badly formatted, '
152- "<xyz>; rel='foo',"
153- '<http://a.custom.hub/>; rel="hub"' ,
154- })
155-
156- got = self .client .get ('/acct:foo.com' , headers = {'Accept' : 'application/json' })
157- self .assertEqual (200 , got .status_code )
158- self .assertIn ({
159- 'rel' : 'hub' ,
160- 'href' : 'http://a.custom.hub/' ,
161- }, got .json ['links' ])
162-
163108 @mock .patch ('requests.get' )
164109 def test_user_no_hcard (self , mock_get ):
165110 mock_get .return_value = requests_response ("""
@@ -175,7 +120,6 @@ def test_user_no_hcard(self, mock_get):
175120 self .assert_equals ({
176121 'subject' : 'acct:foo.com@foo.com' ,
177122 'aliases' : ['https://foo.com/' ],
178- 'magic_keys' : [{'value' : self .key .href ()}],
179123 'links' : [{
180124 'rel' : 'http://webfinger.net/rel/profile-page' ,
181125 'type' : 'text/html' ,
@@ -196,16 +140,6 @@ def test_user_no_hcard(self, mock_get):
196140 'rel' : 'sharedInbox' ,
197141 'type' : 'application/activity+json' ,
198142 'href' : 'http://localhost/inbox'
199- }, {
200- 'rel' : 'http://schemas.google.com/g/2010#updates-from' ,
201- 'type' : 'application/atom+xml' ,
202- 'href' : 'https://granary.io/url?input=html&output=atom&url=https%3A%2F%2Ffoo.com%2F&hub=https%3A%2F%2Ffoo.com%2F' ,
203- }, {
204- 'rel' : 'hub' ,
205- 'href' : 'https://bridgy-fed.superfeedr.com/'
206- }, {
207- 'rel' : 'magic-public-key' ,
208- 'href' : self .key .href (),
209143 }, {
210144 'rel' : 'http://ostatus.org/schema/1.0/subscribe' ,
211145 'template' : 'http://localhost/user/foo.com?url={uri}' ,
0 commit comments