示例#1
0
class CommentPinTest(TestCase):
    fixtures = ['user.json', 'member.json', 'pins.json']

    def setUp(self):
        self.client = TestClient()
        self.client = TestClient()
        self.user = User.objects.get(username='******')
        self.member = self.user.get_profile()
        self.client.login_user(self.user)

    def test_get_comments_for_pin(self):
        res = self.client.get('/api/pin/%s/comment/')
        self.assertEquals(200, res.status_code)

    def test_create_comment_on_pin(self):
        pass
示例#2
0
文件: test_base.py 项目: kiennt/pinry
class TestBaseAPI(TestCase):
    fixtures = ['user.json', 'member.json', 'pins.json']

    def setUp(self):
        self.client = TestClient()
        self.user = User.objects.get(username='******')
        self.member = self.user.get_profile()
        self.client.login_user(self.user)

    def count_pins(self, member):
        return Pin.objects.filter(submitter=member).count()

    def create_new_pin(self, member):
        return Pin.objects.create(
                submitter=member,
                url='',
                image='test.jpg',
                thumbnail='test_thumb.jpg')
示例#3
0
class TestRecentPins(TestCase):
    def setUp(self):
        self.client = TestClient()
        self.url = '/api/pin/?format=json'

    def test_status_code(self):
        response = self.client.get(self.url)
        self.assertEqual(response.status_code, 200)

    def test_delete_pin(self):
        pass

    def test_get_list_pins(self):
        pass

    def test_get_pin(self):
        pass
示例#4
0
 def setUp(self):
     self.client = TestClient()
     self.url = '/api/pin/?format=json'
示例#5
0
 def setUp(self):
     self.client = TestClient()
     self.client = TestClient()
     self.user = User.objects.get(username='******')
     self.member = self.user.get_profile()
     self.client.login_user(self.user)