Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from server import app, login_manager, system
- from system import *
- #adds history entries for patients Isaac, Hao, Tom, Jack
- def test_add_history():
- date = "2018-11-02"
- patient = "Isaac"
- patient_email = "isaac@gmail.com"
- provider = "Toby"
- healthCentre = "Sydney Hospital"
- notes = "sick"
- prescription = "Panadol"
- history = system.get_history(patient_email)
- check = len(history)
- system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
- history = system.get_history(patient_email)
- assert(len(history) == check + 1)
- def test_add_history_1():
- date = "2018-12-02"
- patient = "Hao"
- patient_email = "hao@gmail.com"
- provider = "Toby"
- healthCentre = "Sydney Hospital"
- notes = "sick"
- prescription = "Panadol"
- history = system.get_history(patient_email)
- check = len(history)
- system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
- history = system.get_history(patient_email)
- assert(len(history) == check + 1)
- def test_add_history_2():
- date = "2018-12-03"
- patient = "Tom"
- patient_email = "tom@gmail.com"
- provider = "Toby"
- healthCentre = "Sydney Hospital"
- notes = "sick"
- prescription = "Panadol"
- history = system.get_history(patient_email)
- check = len(history)
- system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
- history = system.get_history(patient_email)
- assert(len(history) == check + 1)
- def test_add_history_3():
- date = "2018-12-05"
- patient = "Jack"
- patient_email = "jack@gmail.com"
- provider = "Toby"
- healthCentre = "Sydney Hospital"
- notes = "sick"
- prescription = "Panadol"
- history = system.get_history(patient_email)
- check = len(history)
- system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
- history = system.get_history(patient_email)
- assert(len(history) == check + 1)
- def test_add_history_4():
- date = "2018-12-10"
- patient = "Tom"
- patient_email = "tom@gmail.com"
- provider = "Toby"
- healthCentre = "Sydney Hospital"
- notes = "sick"
- prescription = "Panadol"
- history = system.get_history(patient_email)
- check = len(history)
- system.addHistory(date,patient,patient_email,provider,healthCentre,notes,prescription)
- history = system.get_history(patient_email)
- assert(len(history) == check + 1)
- #after adding Tom, Hao, Jack, Isaac making sure that there is greater than 0 entries also asserting that providers have no entries
- def test_history():
- patient_email = "isaac@gmail.com"
- history = system.get_history(patient_email)
- assert(len(history) > 0)
- def test_history_1():
- patient_email = "tom@gmail.com"
- history = system.get_history(patient_email)
- assert(len(history) > 0)
- def test_history_2():
- patient_email = "jack@gmail.com"
- history = system.get_history(patient_email)
- assert(len(history) > 0)
- def test_history_3():
- patient_email = "hao@gmail.com"
- history = system.get_history(patient_email)
- assert(len(history) > 0)
- def test_history_4():
- patient_email = "toby@gmail.com"
- history = system.get_history(patient_email)
- assert(len(history) == 0)
- def test_history_5():
- patient_email = "gary@gmail.com"
- history = system.get_history(patient_email)
- assert(len(history) == 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement