コード例 #1
0
ファイル: test_views.py プロジェクト: yewtzeee/edx-platform
    def test_order_found(self):
        """ If the order is located, the view should pass the data from the API. """

        with mock_basket_order(basket_id=1, response=self.MOCK_ORDER):
            response = self.client.get(self.path)

        self.assertEqual(response.status_code, 200)
        actual = json.loads(response.content)
        self.assertEqual(actual, self.MOCK_ORDER)
コード例 #2
0
ファイル: test_views.py プロジェクト: longmen21/edx-platform
    def test_order_found(self):
        """ If the order is located, the view should pass the data from the API. """

        with mock_basket_order(basket_id=1, response=self.MOCK_ORDER):
            response = self.client.get(self.path)

        self.assertEqual(response.status_code, 200)
        actual = json.loads(response.content)
        self.assertEqual(actual, self.MOCK_ORDER)
コード例 #3
0
ファイル: test_views.py プロジェクト: yewtzeee/edx-platform
 def test_order_not_found(self):
     """ If the order is not found, the view should return a 404. """
     with mock_basket_order(basket_id=1,
                            exception=exceptions.HttpNotFoundError):
         response = self.client.get(self.path)
     self.assertEqual(response.status_code, 404)
コード例 #4
0
ファイル: test_views.py プロジェクト: longmen21/edx-platform
 def test_order_not_found(self):
     """ If the order is not found, the view should return a 404. """
     with mock_basket_order(basket_id=1, exception=exceptions.HttpNotFoundError):
         response = self.client.get(self.path)
     self.assertEqual(response.status_code, 404)