Explorar el Código

Write more tests for the ImageResource

tags/v1.0.0
Krzysztof Klimonda hace 11 años
padre
commit
559f054985
Se han modificado 1 ficheros con 4 adiciones y 5 borrados
  1. +4
    -5
      pinry/core/tests.py

+ 4
- 5
pinry/core/tests.py Ver fichero

@@ -1,7 +1,6 @@
import mock

from django.conf import settings
from django.test.client import Client

from django_images.models import Thumbnail
from taggit.models import Tag
@@ -30,11 +29,11 @@ def mock_storage_path(self, name):
@mock.patch('django.core.files.storage.FileSystemStorage.path', mock_storage_path)
class ImageResourceTest(ResourceTestCase):
fixtures = ['test_resources.json']
pass

def setUp(self):
super(ImageResourceTest, self).setUp()
self.client = Client()
def test_post_create_unsupported(self):
"""Make sure that new images can't be created using API"""
response = self.api_client.post('/api/v1/image/', format='json', data={})
self.assertHttpUnauthorized(response)

def test_list_detail(self):
image = Image.objects.get(pk=1)


Cargando…
Cancelar
Guardar