Ejemplo n.º 1
0
    def testNotDelete(self):
        """Attempt to get reminders that don't exist"""
        expectedResult = '[]'
        
        response = api.getReminders('patient2')

        self.assertEqual(response, expectedResult)
Ejemplo n.º 2
0
    def testLegitimate(self):
        """Attempt to get a reminder"""
        expectedResult = {
            "username": "******", 
            "content": "test", 
            "reminderClass": "info", 
            "relatedObject": 1,
            "relatedObjectTable": "Appointments"
        }
        
        response = api.getReminders('patient')
        jsonResponse = json.loads(response)

        self.assertEqual(jsonResponse[0]['username'], expectedResult['username'])
        self.assertEqual(jsonResponse[0]['content'], expectedResult['content'])
        self.assertEqual(jsonResponse[0]['reminderClass'], expectedResult['reminderClass'])
        self.assertEqual(jsonResponse[0]['relatedObject'], expectedResult['relatedObject'])
        self.assertEqual(jsonResponse[0]['relatedObjectTable'], expectedResult['relatedObjectTable'])