示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)