def test_subscription_verification(self): request = testing.DummyRequest() request.registry.settings[ENVIRONMENT_KEY] = {'feed': {'verify_token': self.verify_token}} request.GET = self._create_multidict() result = get_facebook_feed(request) self.assertEqual(result.status_int, 200) self.assertEqual(result.body, 'secret')
def test_incorrect_token(self): request = testing.DummyRequest() request.registry.settings[ENVIRONMENT_KEY] = {'feed': {'verify_token': self.verify_token}} request.GET = self._create_multidict() request.GET.pop('hub.verify_token') request.GET.add('hub.verify_token', 'incorrect') result = get_facebook_feed(request) self.assertEqual(result.status_int, 404)