def test_upload_without_permission(self):
        self.jon.user_permissions.remove(self.add_permission)

        self.client.login(**self.cred_jon)
        self._upload_testfile()
        self.assertEqual(Attachment.objects.count(), 0)
        self.assertEqual(Attachment.objects.attachments_for_object(self.obj).count(), 0)
Remove the 'add permission' and try to upload a file.
dataset/ETHPy150Open bartTC/django-attachments/attachments/tests/test_views.py/ViewTestCase.test_upload_without_permission