diff --git a/tests/py/fixtures/TestElsewhere.yml b/tests/py/fixtures/TestElsewhere.yml new file mode 100644 index 0000000000..257be8d294 --- /dev/null +++ b/tests/py/fixtures/TestElsewhere.yml @@ -0,0 +1,25 @@ +interactions: +- request: + body: null + headers: {} + method: GET + uri: https://api.twitter.com:443/1.1/users/show.json?screen_name=nmjhgfcftyuikjnbvftyujhbgtfgh + response: + body: + string: !!binary | + H4sIAAAAAAAAAKpWSi0qyi8qVrKKrlbKTS0uTkxPVbJSCs4vKqrUUSjJSCxRKAAKKaTkpxYr5OWX + KKRWZBaXKOkoJeenABUam9TG1gIAAAD//wMAke1ZcEQAAAA= + headers: + cache-control: ['no-cache, no-store, must-revalidate, pre-check=0, post-check=0'] + content-encoding: [gzip] + content-length: ['92'] + content-type: [application/json;charset=utf-8] + expires: ['Tue, 31 Mar 1981 05:00:00 GMT'] + last-modified: ['Wed, 03 Dec 2014 17:19:23 GMT'] + pragma: [no-cache] + set-cookie: ['guest_id=v1%3A141762716382867775; Domain=.twitter.com; Path=/; + Expires=Fri, 02-Dec-2016 17:19:23 UTC'] + status: [404 Not Found] + strict-transport-security: [max-age=631138519] + status: {code: 404, message: Not Found} +version: 1 diff --git a/tests/py/test_elsewhere.py b/tests/py/test_elsewhere.py index 17158ad495..464957bce4 100644 --- a/tests/py/test_elsewhere.py +++ b/tests/py/test_elsewhere.py @@ -103,3 +103,8 @@ def test_user_pages(self): response = self.client.GET('/on/%s/alice/' % platform.name) assert response.code == 200 assert 'has not joined' in response.body.decode('utf8') + + + def test_failure_page_requires_valid_username(self): + response = self.client.GxT('/on/twitter/nmjhgfcftyuikjnbvftyujhbgtfgh/failure.html?action') + assert response.code == 404