jamalbrowning / forgotten-potatoes-client

0 stars 0 forks source link

Test Get all Reviews #23

Open jamalbrowning opened 3 years ago

jamalbrowning commented 3 years ago

Create a test to get all reviews for user.

Example

def test_get_all_products(self):
        """
        Ensure we can get a collection of products.
        """
        self.test_create_product()
        self.test_create_product()
        self.test_create_product()

        url = "/products"

        response = self.client.get(url, None, format='json')
        json_response = json.loads(response.content)
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(len(json_response), 3)