Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST Review can be deleted #12

Open
jamalbrowning opened this issue Feb 27, 2021 · 0 comments
Open

TEST Review can be deleted #12

jamalbrowning opened this issue Feb 27, 2021 · 0 comments
Labels
MVP This issue or pull request already exists

Comments

@jamalbrowning
Copy link
Owner

jamalbrowning commented Feb 27, 2021

Create TEST so reviews can be deleted.

Example

def test_delete_product(self):
        """
        Ensure we can remove a product.
        """
        # add product
        self.test_get_all_products()

        # remove product
        url = "/products/1"
        data = {"id": 1}
        self.client.credentials(HTTP_AUTHORIZATION='Token ' + self.token)
        response = self.client.delete(url, data, format='json')

        self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)

        # get products and verify product was removed
        url = "/products/1"
        self.client.credentials(HTTP_AUTHORIZATION='Token ' + self.token)
        response = self.client.get(url, None, format='json')

        self.assertEqual(response.status_code,
                         status.HTTP_500_INTERNAL_SERVER_ERROR)
@jamalbrowning jamalbrowning added the MVP This issue or pull request already exists label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MVP This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant