From ea087caab40be2337586f59267d5334a61e1d34a Mon Sep 17 00:00:00 2001 From: Isaac Bythewood Date: Thu, 10 May 2012 03:19:35 +0000 Subject: [PATCH] Finished adding basic tests with the API, time to start fleshing them out. --- pinry/api/models.py | 0 pinry/api/tests.py | 16 ++++++++++++++++ pinry/pins/tests.py | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 pinry/api/models.py create mode 100644 pinry/api/tests.py diff --git a/pinry/api/models.py b/pinry/api/models.py new file mode 100644 index 0000000..e69de29 diff --git a/pinry/api/tests.py b/pinry/api/tests.py new file mode 100644 index 0000000..abdee6a --- /dev/null +++ b/pinry/api/tests.py @@ -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) diff --git a/pinry/pins/tests.py b/pinry/pins/tests.py index b4151eb..510422e 100644 --- a/pinry/pins/tests.py +++ b/pinry/pins/tests.py @@ -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',