Explorar el Código

Finished adding basic tests with the API, time to start fleshing them out.

tags/v0.3.0
Isaac Bythewood hace 12 años
padre
commit
ea087caab4
Se han modificado 3 ficheros con 17 adiciones y 1 borrados
  1. +0
    -0
      pinry/api/models.py
  2. +16
    -0
      pinry/api/tests.py
  3. +1
    -1
      pinry/pins/tests.py

+ 0
- 0
pinry/api/models.py Ver fichero


+ 16
- 0
pinry/api/tests.py Ver fichero

@@ -0,0 +1,16 @@
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse


class RecentPinsTest(TestCase):
def setUp(self):
self.client = Client()
self.url = reverse('api:pins-recent', args=[0])

def test_url(self):
self.assertEqual(self.url, '/api/pins/recent/0/')

def test_status_code(self):
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)

+ 1
- 1
pinry/pins/tests.py Ver fichero

@@ -53,7 +53,7 @@ class NewPinTest(TestCase):

# Already Pinned
response = self.client.post(self.url, {
'url': 'https://github.com/overshard/pinry/raw/master/screenshot.png',
'url': 'http://github.com/overshard/pinry/raw/master/screenshot.png',
})
response = self.client.post(self.url, {
'url': 'https://github.com/overshard/pinry/raw/master/screenshot.png',


Cargando…
Cancelar
Guardar