mirror of
https://github.com/pinry/pinry.git
synced 2026-01-26 17:19:23 +01:00
Finished adding basic tests with the API, time to start fleshing them out.
This commit is contained in:
0
pinry/api/models.py
Normal file
0
pinry/api/models.py
Normal file
16
pinry/api/tests.py
Normal file
16
pinry/api/tests.py
Normal 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)
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user