Browse Source

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

tags/v0.3.0
Isaac Bythewood 12 years ago
parent
commit
ea087caab4
3 changed files with 17 additions and 1 deletions
  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 View File


+ 16
- 0
pinry/api/tests.py 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)

+ 1
- 1
pinry/pins/tests.py 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',


Loading…
Cancel
Save