def testNotToday(self): """Attempt to check a prescription that is not due to be taken today""" api.createTakePrescriptionInstances('patient2', datetime.datetime.now()) with self.assertRaises(testDatabase.TakePrescription.DoesNotExist): testDatabase.TakePrescription.select().where(testDatabase.TakePrescription.currentdate == (datetime.datetime.now().date() + datetime.timedelta(days = 3))).get()
def testAlreadyCreated(self): """Attempt to create another take prescription instances after already created""" api.createTakePrescriptionInstances('patient3', datetime.datetime.now()) self.assertEqual(testDatabase.TakePrescription.select().where(testDatabase.TakePrescription.prescriptionid == 3).count(),1)
def testLegitimate(self): """Attempt to check an prescription that is due to be taken today""" api.createTakePrescriptionInstances('patient', datetime.datetime.now()) self.assertEqual(testDatabase.TakePrescription.select().count(),2)