コード例 #1
0
ファイル: test_medical.py プロジェクト: magul/asm3
 def test_regimen_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     data = {
         "startdate": base.today_display(),
         "treatmentname": "Test",
         "dosage": "Test",
         "timingrule": "1",
         "timingrulenofrequencies": "1",
         "timingrulefrequency": "1",
         "totalnumberoftreatments": "1",
         "treatmentrule": "1",
         "singlemulti": "1"
     }
     post = utils.PostedData(data, "en")   
     mid = medical.insert_regimen_from_form(base.get_dbo(), "test", post)
     medical.update_regimen_from_form(base.get_dbo(), "test", post)
     medical.delete_regimen(base.get_dbo(), "test", mid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #2
0
 def test_regimen_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post,
                                                "test")
     data = {
         "startdate": base.today_display(),
         "treatmentname": "Test",
         "dosage": "Test",
         "timingrule": "1",
         "timingrulenofrequencies": "1",
         "timingrulefrequency": "1",
         "totalnumberoftreatments": "1",
         "treatmentrule": "1",
         "singlemulti": "1"
     }
     post = utils.PostedData(data, "en")
     mid = medical.insert_regimen_from_form(base.get_dbo(), "test", post)
     medical.update_regimen_from_form(base.get_dbo(), "test", post)
     medical.delete_regimen(base.get_dbo(), "test", mid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #3
0
ファイル: test_movement.py プロジェクト: magul/asm3
 def test_transport_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     data = {
         "animal": "1",
         "driver": "1",
         "pickup": "1",
         "dropoff": "1",
         "pickupdate": base.today_display(),
         "dropoffdate": base.today_display(),
         "status": "1"
     }
     post = utils.PostedData(data, "en")
     tid = movement.insert_transport_from_form(base.get_dbo(), "test", post)
     post.data["transportid"] = str(tid)
     movement.update_transport_from_form(base.get_dbo(), "test", post)
     movement.delete_transport(base.get_dbo(), "test", tid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #4
0
ファイル: test_diary.py プロジェクト: magul/asm3
 def test_execute_diary_task(self):
     data = {
         "animalname": "TestioDiary",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     animalid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     data = {
         "name": "Test",
         "type": "0"
     }
     post = utils.PostedData(data, "en")
     headid = diary.insert_diarytaskhead_from_form(base.get_dbo(), "test", post)
     diary.update_diarytaskhead_from_form(base.get_dbo(), "test", post)
     data = {
         "taskid": str(headid),
         "daypivot": "1",
         "whofor":   "user",
         "subject":  "Testtask",
         "note":     "Testtasknote"
     }
     post = utils.PostedData(data, "en")
     diary.insert_diarytaskdetail_from_form(base.get_dbo(), "test", post)
     diary.update_diarytaskdetail_from_form(base.get_dbo(), "test", post)
     diary.execute_diary_task(base.get_dbo(), "test", diary.ANIMAL, headid, animalid, base.today())
     diary.delete_diarytask(base.get_dbo(), "test", headid)
     animal.delete_animal(base.get_dbo(), "test", animalid)
コード例 #5
0
 def test_transport_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post,
                                                "test")
     data = {
         "animal": "1",
         "driver": "1",
         "pickup": "1",
         "dropoff": "1",
         "pickupdate": base.today_display(),
         "dropoffdate": base.today_display(),
         "status": "1"
     }
     post = utils.PostedData(data, "en")
     tid = movement.insert_transport_from_form(base.get_dbo(), "test", post)
     post.data["transportid"] = str(tid)
     movement.update_transport_from_form(base.get_dbo(), "test", post)
     movement.delete_transport(base.get_dbo(), "test", tid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #6
0
ファイル: test_media.py プロジェクト: magul/asm3
 def test_attach_file_from_form(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     nid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     f = open(base.PATH + "../src/media/reports/nopic.jpg", "rb")
     data = f.read()
     f.close()
     post = utils.PostedData({ "base64image": "data:" + base64.b64encode(data) }, "en")
     media.attach_file_from_form(base.get_dbo(), "test", media.ANIMAL, nid, post)
     animal.delete_animal(base.get_dbo(), "test", nid)
コード例 #7
0
ファイル: test_medical.py プロジェクト: magul/asm3
 def test_vaccination_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     data = {
         "animal": str(aid),
         "required": base.today_display(),
         "type": "1"
     }
     post = utils.PostedData(data, "en")
     vid = medical.insert_vaccination_from_form(base.get_dbo(), "test", post)
     medical.update_vaccination_from_form(base.get_dbo(), "test", post)
     medical.delete_regimen(base.get_dbo(), "test", vid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #8
0
ファイル: test_movement.py プロジェクト: magul/asm3
 def test_movement_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     data = {
         "animal": str(aid),
         "person": 1,
         "movementdate": base.today_display(),
         "type": "1",
     }
     post = utils.PostedData(data, "en")
     mid = movement.insert_movement_from_form(base.get_dbo(), "test", post)
     post.data["movementid"] = str(mid)
     movement.update_movement_from_form(base.get_dbo(), "test", post)
     movement.delete_movement(base.get_dbo(), "test", mid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #9
0
ファイル: test_medical.py プロジェクト: magul/asm3
 def test_test_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
     data = {
         "animal": str(aid),
         "required": base.today_display(),
         "type": "1",
         "result": "1"
     }
     post = utils.PostedData(data, "en")
     tid = medical.insert_test_from_form(base.get_dbo(), "test", post)
     post.data["testid"] = str(tid)
     medical.update_test_from_form(base.get_dbo(), "test", post)
     medical.delete_test(base.get_dbo(), "test", tid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #10
0
 def test_vaccination_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post,
                                                "test")
     data = {
         "animal": str(aid),
         "required": base.today_display(),
         "type": "1"
     }
     post = utils.PostedData(data, "en")
     vid = medical.insert_vaccination_from_form(base.get_dbo(), "test",
                                                post)
     medical.update_vaccination_from_form(base.get_dbo(), "test", post)
     medical.delete_regimen(base.get_dbo(), "test", vid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #11
0
 def test_movement_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post,
                                                "test")
     data = {
         "animal": str(aid),
         "person": 1,
         "movementdate": base.today_display(),
         "type": "1",
     }
     post = utils.PostedData(data, "en")
     mid = movement.insert_movement_from_form(base.get_dbo(), "test", post)
     post.data["movementid"] = str(mid)
     movement.update_movement_from_form(base.get_dbo(), "test", post)
     movement.delete_movement(base.get_dbo(), "test", mid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #12
0
ファイル: test_media.py プロジェクト: tgage/asm3
 def test_attach_file_from_form(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     nid, code = animal.insert_animal_from_form(base.get_dbo(), post,
                                                "test")
     f = open(base.PATH + "../src/media/reports/nopic.jpg", "rb")
     data = f.read()
     f.close()
     post = utils.PostedData(
         {
             "filename": "image.jpg",
             "filetype": "image/jpeg",
             "filedata": "data:image/jpeg;base64," + base64.b64encode(data)
         }, "en")
     media.attach_file_from_form(base.get_dbo(), "test", media.ANIMAL, nid,
                                 post)
     animal.delete_animal(base.get_dbo(), "test", nid)
コード例 #13
0
 def test_test_crud(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     aid, code = animal.insert_animal_from_form(base.get_dbo(), post,
                                                "test")
     data = {
         "animal": str(aid),
         "required": base.today_display(),
         "type": "1",
         "result": "1"
     }
     post = utils.PostedData(data, "en")
     tid = medical.insert_test_from_form(base.get_dbo(), "test", post)
     post.data["testid"] = str(tid)
     medical.update_test_from_form(base.get_dbo(), "test", post)
     medical.delete_test(base.get_dbo(), "test", tid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #14
0
ファイル: test_animal.py プロジェクト: tgage/asm3
 def tearDown(self):
     animal.delete_animal(base.get_dbo(), "test", self.nid)
コード例 #15
0
ファイル: test_animal.py プロジェクト: tgage/asm3
 def test_clone_animal(self):
     nid = animal.clone_animal(base.get_dbo(), "test", self.nid)
     assert nid != 0
     animal.delete_animal(base.get_dbo(), "test", nid)
コード例 #16
0
ファイル: test_lostfound.py プロジェクト: magul/asm3
 def test_create_animal_from_found(self):
     aid = lostfound.create_animal_from_found(base.get_dbo(), "test", self.faid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #17
0
 def test_create_animal(self):
     aid = waitinglist.create_animal(base.get_dbo(), "test", self.wlid)
     assert aid is not None and aid > 0
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #18
0
ファイル: test_animal.py プロジェクト: magul/asm3
 def test_clone_animal(self):
     nid = animal.clone_animal(base.get_dbo(), "test", self.nid)
     assert nid != 0
     animal.delete_animal(base.get_dbo(), "test", nid)
コード例 #19
0
ファイル: test_animal.py プロジェクト: magul/asm3
 def tearDown(self):
     animal.delete_animal(base.get_dbo(), "test", self.nid)
コード例 #20
0
 def test_create_animal_from_found(self):
     aid = lostfound.create_animal_from_found(base.get_dbo(), "test", self.faid)
     animal.delete_animal(base.get_dbo(), "test", aid)
コード例 #21
0
ファイル: test_waitinglist.py プロジェクト: magul/asm3
 def test_create_animal(self):
     aid = waitinglist.create_animal(base.get_dbo(), "test", self.wlid)
     assert aid is not None and aid > 0
     animal.delete_animal(base.get_dbo(), "test", aid)