def assert_success(self, method, host, origin, referer, xrw): try: verify_cross_site_request(mock_site_loader, method, host, origin, referer, xrw) except DomainRelationshipException as e: message = ('Expected: ok, got error: %s for %r' % (e, [method, host, origin, referer, xrw])) self.fail(message)
def assert_failure(self, expected_fail, method, host, origin, referer, xrw): try: verify_cross_site_request(mock_site_loader, method, host, origin, referer, xrw) message = ('Expected error: %s, got success for %r' % (expected_fail, [method, host, origin, referer, xrw])) self.fail(message) except DomainRelationshipException as e: self.assertEqual(expected_fail, e.message)
def assert_success(self, method, host, origin, referer, xrw): try: verify_cross_site_request( mock_site_loader, method, host, origin, referer, xrw) except DomainRelationshipException as e: message = ('Expected: ok, got error: %s for %r' % ( e, [method, host, origin, referer, xrw])) self.fail(message)
def assert_failure(self, expected_fail, method, host, origin, referer, xrw): try: verify_cross_site_request( mock_site_loader, method, host, origin, referer, xrw) message = ('Expected error: %s, got success for %r' % ( expected_fail, [method, host, origin, referer, xrw])) self.fail(message) except DomainRelationshipException as e: self.assertEqual(expected_fail, e.message)