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

This commit is contained in:
Isaac Bythewood
2012-05-10 03:19:35 +00:00
parent 09b5be250d
commit ea087caab4
3 changed files with 17 additions and 1 deletions

0
pinry/api/models.py Normal file
View File

16
pinry/api/tests.py Normal file
View File

@@ -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)

View File

@@ -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',