Exemplo n.º 1
0
    def testInvalidMonth(self):
        """>>>test use 3 digits for month"""
        username = '******'
        month= 123
        APIRequestFactory().get('/api/v1/birthdays/'+ username +'/'+ str(month)+'/')

        request1 	= APIRequestFactory().get('/api/v1/birthdays/'+ username +'/'+ str(month)+'/')
        get_detail  = MonthBirthdayListViewSet.as_view({'get': 'list'})

        response1 	= get_detail(request1,username=username, month=unicode(month))

        self.assertEqual(response1.status_code,status.HTTP_400_BAD_REQUEST)
Exemplo n.º 2
0
    def testListingMonthBirthdays(self):
        """>>>test listing friend who are birthdaying on the specific month"""
        username = '******'
        month = 1

        APIRequestFactory().get('/api/v1/birthdays/'+username +'/'+ str(month)+'/')

        request1 	= APIRequestFactory().get('/api/v1/birthdays/'+ username +'/'+ str(month)+'/')
        get_detail  = MonthBirthdayListViewSet.as_view({'get': 'list'})

        response1 	= get_detail(request1,username=username, month=unicode(month))

        self.assertEqual(response1.status_code,status.HTTP_200_OK)