def testInvalidNotificationType(self): """Attempt to create a notification with a Notification Type that does not exist || check that the API returns expected response and DB contains no notifications""" user = "******" notificationType = "Does Not Exist" relatedObject = 1 createNotification = api.createNotificationRecord(user, notificationType, relatedObject) self.assertEqual(createNotification, "Invalid Notification Type") self.assertEqual(testDatabase.Notification.select().where((testDatabase.Notification.username == "patient") & (testDatabase.Notification.notificationtype == "Does Not Exist")).count(), 0)
def testLegitimate(self): """Attempt to create a legitimate notification || check that API returns expected response and DB is correct too""" user = "******" notificationType = "Connection Request" relatedObject = int(1) #Method is not externally addressable how does this work? createNotification = api.createNotificationRecord(user, notificationType, relatedObject) self.assertEqual(createNotification, "True")
def testInvalidType(self): """Attempt to create a notification with a non Foreign Key type || check that API returns expected response and DB contains no notifications""" user = "******" notificationType = "Connection Added" relatedObject = 1 createNotification = api.createNotificationRecord(user, notificationType, relatedObject) self.assertEqual(createNotification, "Invalid Notification Type") self.assertEqual(testDatabase.Notification.select().where(testDatabase.Notification.username == "patient").count(), 0)