예제 #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
파일: test_pins.py 프로젝트: timonweb/pinry
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
파일: test_pins.py 프로젝트: timonweb/pinry
 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)