浏览代码

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

tags/v0.3.0
Isaac Bythewood 12 年前
父节点
当前提交
ea087caab4
共有 3 个文件被更改,包括 17 次插入1 次删除
  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 查看文件


+ 16
- 0
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)

+ 1
- 1
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',


正在加载...
取消
保存