Пример #1
0
 def get_orderResource(self, order_id):
     order_db = Order.query.get(order_id)
     order = acmeOrder.from_json(json.loads(order_db.contents)['body'])
     orderr = OrderResource.from_json(json.loads(order_db.contents))
     authorizations = []
     for url in order.authorizations:
         authorizations.append(
             self.client._authzr_from_response(
                 self.client._post_as_get(url), uri=url))
     return orderr.update(authorizations=authorizations)
Пример #2
0
class OrderResourceTest(unittest.TestCase):
    """Tests for acme.messages.OrderResource."""

    def setUp(self):
        from acme.messages import OrderResource
        self.regr = OrderResource(
            body=mock.sentinel.body, uri=mock.sentinel.uri)

    def test_to_partial_json(self):
        self.assertEqual(self.regr.to_json(), {
            'body': mock.sentinel.body,
            'uri': mock.sentinel.uri,
            'authorizations': None,
        })
Пример #3
0
class OrderResourceTest(unittest.TestCase):
    """Tests for acme.messages.OrderResource."""

    def setUp(self):
        from acme.messages import OrderResource
        self.regr = OrderResource(
            body=mock.sentinel.body, uri=mock.sentinel.uri)

    def test_to_partial_json(self):
        self.assertEqual(self.regr.to_json(), {
            'body': mock.sentinel.body,
            'uri': mock.sentinel.uri,
            'authorizations': None,
        })
Пример #4
0
 def setUp(self):
     from acme.messages import OrderResource
     self.regr = OrderResource(
         body=mock.sentinel.body, uri=mock.sentinel.uri)
Пример #5
0
 def setUp(self):
     from acme.messages import OrderResource
     self.regr = OrderResource(
         body=mock.sentinel.body, uri=mock.sentinel.uri)