Beispiel #1
0
    def test_default_customer_logo(self):
        self.client.force_authenticate(user=self.staff)
        self.assert_default_logo()

        with dummy_image() as image:
            self.assert_can_upload_image(image)
            self.assert_can_delete_image()

        self.assert_default_logo()
Beispiel #2
0
    def test_user_cannot_upload_logo_for_customer_he_is_not_owner_of(self):
        self.client.force_authenticate(user=self.user)

        with dummy_image() as image:
            response = self.upload_image(self.url, image)
            self.assertEqual(status.HTTP_403_FORBIDDEN, response.status_code)
Beispiel #3
0
    def test_customer_owner_can_upload_and_delete_customer_logo(self):
        self.client.force_authenticate(user=self.owner)

        with dummy_image() as image:
            self.assert_can_upload_image(image)
            self.assert_can_delete_image()