Exemple #1
0
 def setUp(self):
     data = {
         "datelost": base.today_display(),
         "datereported": base.today_display(),
         "owner": "1",
         "species": "1", 
         "sex": "1",
         "breed": "1",
         "colour": "1",
         "markings": "Test",
         "arealost": "Test",
         "areapostcode": "Test"
     }
     post = utils.PostedData(data, "en")
     self.laid = lostfound.insert_lostanimal_from_form(base.get_dbo(), post, "test")
     data = {
         "datefound": base.today_display(),
         "datereported": base.today_display(),
         "owner": "1",
         "species": "1", 
         "sex": "1",
         "breed": "1",
         "colour": "1",
         "markings": "Test",
         "areafound": "Test",
         "areapostcode": "Test"
     }
     post = utils.PostedData(data, "en")
     self.faid = lostfound.insert_foundanimal_from_form(base.get_dbo(), post, "test")
Exemple #2
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)
Exemple #3
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)
Exemple #4
0
 def test_insert_animalcontrol_from_form(self):
     data = {
         "incidentdate":   "01/01/2014",
         "incidenttime":   "00:00:00"
     }
     post = utils.PostedData(data, "en")
     nid = animalcontrol.insert_animalcontrol_from_form(base.get_dbo(), post, "test")
     animalcontrol.delete_animalcontrol(base.get_dbo(), "test", nid)
Exemple #5
0
 def test_search(self):
     search.search(base.get_dbo(), FakeSession(), "test")
     keywords = [ "os", "notforadoption", "notmicrochipped", "hold", "quarantine", "deceased", 
         "forpublish", "people", "vets", "retailers", "staff", "fosterers", "volunteers", "shelters",
         "aco", "homechecked", "homecheckers", "members", "donors", "reservenohomecheck",
         "overduedonations", "activelost", "activefound" ]
     for k in keywords:
         search.search(base.get_dbo(), FakeSession(), k)
Exemple #6
0
 def test_insert_traploan_from_form(self):
     data = {
         "person":   "1",
         "type":     "1",
         "loandate": "01/01/2014"
     }
     post = utils.PostedData(data, "en")
     tid = animalcontrol.insert_traploan_from_form(base.get_dbo(), "test", post)
     animalcontrol.delete_traploan(base.get_dbo(), "test", tid)
Exemple #7
0
 def test_insert_diet_from_form(self):
     data = {
         "animalid": self.nid,
         "type": "1",
         "startdate": base.today_display()
     }
     post = utils.PostedData(data, "en")
     nid = animal.insert_diet_from_form(base.get_dbo(), "test", post)
     animal.delete_diet(base.get_dbo(), "test", nid)
Exemple #8
0
 def test_insert_litter_from_form(self):
     data = {
         "animal": self.nid,
         "species": "1",
         "startdate": base.today_display(),
         "litterref": "RUBBISH"
     }
     post = utils.PostedData(data, "en")
     nid = animal.insert_litter_from_form(base.get_dbo(), "test", post)
     animal.delete_litter(base.get_dbo(), "test", nid)
Exemple #9
0
 def test_investigation_crud(self):
     data = {
         "personid": str(self.nid),
         "date": base.today_display(),
         "notes": "Test"
     }
     post = utils.PostedData(data, "en")
     iid = person.insert_investigation_from_form(base.get_dbo(), "test", post)
     data["investigationid"] = str(iid)
     person.update_investigation_from_form(base.get_dbo(), "test", post)
     person.delete_investigation(base.get_dbo(), "test", iid)
Exemple #10
0
 def test_voucher_crud(self):
     data = {
         "personid": "1",
         "type": "1",
         "issued": base.today_display(),
         "expires": base.today_display(),
         "amount": "1000"
     }
     post = utils.PostedData(data, "en")
     vid = financial.insert_voucher_from_form(base.get_dbo(), "test", post)
     financial.update_voucher_from_form(base.get_dbo(), "test", post)
     financial.delete_voucher(base.get_dbo(), "test", vid)
Exemple #11
0
 def test_citation_crud(self):
     data = {
         "person": "1",
         "incident": "1",
         "type": "1",
         "citationdate": base.today_display(),
         "fineamount": "1000",
         "finedue": base.today_display()
     }
     post = utils.PostedData(data, "en")
     cid = financial.insert_citation_from_form(base.get_dbo(), "test", post)
     financial.update_citation_from_form(base.get_dbo(), "test", post)
     financial.delete_citation(base.get_dbo(), "test", cid)
Exemple #12
0
 def test_accounttrx_crud(self):
     data = {
         "trxdate": base.today_display(),
         "deposit": "1000",
         "withdrawal": "0",
         "accountid": "1",
         "otheraccount": "Income::Donation",
         "description": "Test"
     }
     post = utils.PostedData(data, "en")
     tid = financial.insert_trx_from_form(base.get_dbo(), "test", post)
     financial.update_trx_from_form(base.get_dbo(), "test", post)
     financial.delete_trx(base.get_dbo(), "test", tid)
Exemple #13
0
 def test_account_crud(self):
     base.execute("DELETE FROM accounts WHERE Code LIKE 'Test%'")
     data = {
         "code": "Testio",
         "type": "1",
         "donationtype": "1",
         "description": "Test"
     }
     post = utils.PostedData(data, "en")
     aid = financial.insert_account_from_form(base.get_dbo(), "test", post)
     data["accountid"] = aid
     financial.update_account_from_form(base.get_dbo(), "test", post)
     financial.delete_account(base.get_dbo(), "test", aid)
Exemple #14
0
 def test_insert_update_lookup(self):
     nid = lookups.insert_lookup(base.get_dbo(), "breed", "Test")
     lookups.update_lookup(base.get_dbo(), nid, "breed", "Test")
     lookups.delete_lookup(base.get_dbo(), "breed", nid)
     nid = lookups.insert_lookup(base.get_dbo(), "species", "Test")
     lookups.update_lookup(base.get_dbo(), nid, "species", "Test")
     lookups.delete_lookup(base.get_dbo(), "species", nid)
     nid = lookups.insert_lookup(base.get_dbo(), "vaccinationtype", "Test")
     lookups.update_lookup(base.get_dbo(), nid, "vaccinationtype", "Test")
     lookups.delete_lookup(base.get_dbo(), "vaccinationtype", nid)
Exemple #15
0
 def test_insert_field_from_form(self):
     data = {
         "name":   "addname",
         "label":  "addlabel",
         "tooltip": "addtooltip",
         "lookupvalues": "",
         "mandatory": "off",
         "type": "0",
         "link": "0",
         "displayindex": "1"
     }
     post = utils.PostedData(data, "en")
     nid = additional.insert_field_from_form(base.get_dbo(), "test", post)
     additional.delete_field(base.get_dbo(), "test", nid)
Exemple #16
0
 def test_rota_crud(self):
     data = {
         "person": str(self.nid),
         "startdate": base.today_display(),
         "starttime": "00:00",
         "enddate": base.today_display(),
         "endtime": "00:00",
         "type": "1"
     }
     post = utils.PostedData(data, "en")
     rid = person.insert_rota_from_form(base.get_dbo(), "test", post)
     data["rotaid"] = str(rid)
     person.update_rota_from_form(base.get_dbo(), "test", post)
     person.delete_rota(base.get_dbo(), "test", rid)
Exemple #17
0
 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)
Exemple #18
0
 def test_receive_donation(self):
     data = {
         "person": "1",
         "animal": "1",
         "type":   "1",
         "payment": "1",
         "frequency": "0",
         "amount": "1000",
         "due": base.today()
     }
     post = utils.PostedData(data, "en")
     did = financial.insert_donation_from_form(base.get_dbo(), "test", post)
     financial.update_donation_from_form(base.get_dbo(), "test", post)
     financial.receive_donation(base.get_dbo(), "test", did)
     financial.delete_donation(base.get_dbo(), "test", did)
Exemple #19
0
 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)
Exemple #20
0
 def test_stock_take_from_mobile_form(self):
     data = {
         "sl%d" % self.nid: "5",
         "usagetype": "1"
     }
     post = utils.PostedData(data, "en")
     stock.stock_take_from_mobile_form(base.get_dbo(), "test", post)
Exemple #21
0
 def test_update_animalcontrol_from_form(self):
     data = {
         "incidentdate":   "01/01/2014",
         "incidenttime":   "00:00:00"
     }
     post = utils.PostedData(data, "en")
     animalcontrol.update_animalcontrol_from_form(base.get_dbo(), post, "test")
Exemple #22
0
 def test_profile_crud(self):
     data = {
         "profilename": "Test", 
         "treatmentname": "Test",
         "dosage": "Test",
         "timingrule": "1",
         "timingrulenofrequencies": "1",
         "timingrulefrequency": "1",
         "totalnumberoftreatments": "1",
         "treatmentrule": "1",
         "singlemulti": "1"
     }
     post = utils.PostedData(data, "en")   
     mid = medical.insert_profile_from_form(base.get_dbo(), "test", post)
     medical.update_profile_from_form(base.get_dbo(), "test", post)
     medical.delete_profile(base.get_dbo(), "test", mid)
Exemple #23
0
 def test_licence_crud(self):
     base.execute("DELETE FROM ownerlicence WHERE LicenceNumber = 'LICENCE'")
     data = {
         "person": "1",
         "animal": "1",
         "type": "1",
         "number": "LICENCE",
         "fee": "1000",
         "issuedate": base.today_display(),
         "expirydate": base.today_display()
     }
     post = utils.PostedData(data, "en")
     lid = financial.insert_licence_from_form(base.get_dbo(), "test", post)
     data["licenceid"] = str(lid)
     financial.update_licence_from_form(base.get_dbo(), "test", post)
     financial.delete_licence(base.get_dbo(), "test", lid)
Exemple #24
0
 def test_update_traploan_from_form(self):
     data = {
         "person":   "2",
         "type":     "2",
         "loandate": "01/01/2014"
     }
     post = utils.PostedData(data, "en")
     animalcontrol.update_traploan_from_form(base.get_dbo(), "test", post)
Exemple #25
0
 def test_update_cost_from_form(self):
     data = {
         "animalid": self.nid,
         "type": "1",
         "costdate": base.today_display(),
         "cost": "2000"
     }
     post = utils.PostedData(data, "en")
     animal.update_cost_from_form(base.get_dbo(), "test", post)
Exemple #26
0
 def test_update_diary_from_form(self):
     data = {
         "diarydate":   base.today_display(),
         "diarytime":   "09:00",
         "diaryfor":    "user",
         "subject":     "Test",
         "note":        "TestNote"
     }
     post = utils.PostedData(data, "en")
     diary.update_diary_from_form(base.get_dbo(), "test", post)
Exemple #27
0
 def test_deduct_stocklevel_from_form(self):
     data = {
         "item": str(self.nid),
         "quantity": "1",
         "usagetype": "1",
         "usagedate": base.today_display(),
         "comments": "test"
     }
     post = utils.PostedData(data, "en")
     stock.deduct_stocklevel_from_form(base.get_dbo(), "test", post)
Exemple #28
0
 def setUp(self):
     data = {
         "animalname": "Testio",
         "estimatedage": "1",
         "animaltype": "1",
         "entryreason": "1",
         "species": "1"
     }
     post = utils.PostedData(data, "en")
     self.nid, self.code = animal.insert_animal_from_form(base.get_dbo(), post, "test")
Exemple #29
0
 def setUp(self):
     data = {
         "title": "Mr",
         "forenames": "Test",
         "surname": "Testing",
         "ownertype": "1",
         "address": "123 test street"
     }
     post = utils.PostedData(data, "en")
     self.nid = person.insert_person_from_form(base.get_dbo(), post, "test")
Exemple #30
0
 def setUp(self):
     data = {
         "diarydate":   base.today_display(),
         "diarytime":   "09:00",
         "diaryfor":    "user",
         "subject":     "Test",
         "note":        "TestNote"
     }
     post = utils.PostedData(data, "en")
     self.nid = diary.insert_diary_from_form(base.get_dbo(), "test", 0, 0, post)
Exemple #31
0
 def test_get_vouchers(self):
     financial.get_vouchers(base.get_dbo(), 0)
 def test_update_pass_homecheck(self):
     asm3.person.update_pass_homecheck(base.get_dbo(), "test", self.nid, "")
Exemple #33
0
 def test_generate_image_pdf(self):
     with open(
             "%s/static/images/splash/splash_logo.jpg" %
             base.get_dbo().installpath, "rb") as f:
         asm3.utils.generate_image_pdf("en", f.read())
 def test_get_towns(self):
     asm3.person.get_towns(base.get_dbo())
 def test_get_person_name_code(self):
     assert "" != asm3.person.get_person_name_code(base.get_dbo(), self.nid)
Exemple #36
0
 def test_get_licence_find_simple(self):
     financial.get_licence_find_simple(base.get_dbo(), "")
 def test_get_homechecked(self):
     assert 0 == len(asm3.person.get_homechecked(base.get_dbo(), self.nid))
 def test_get_rota(self):
     asm3.person.get_rota(base.get_dbo(), base.today(), base.today())
 def tearDown(self):
     asm3.person.delete_person(base.get_dbo(), "test", self.nid)
 def test_get_links(self):
     asm3.person.get_links(base.get_dbo(), self.nid)
 def test_get_investigation(self):
     asm3.person.get_investigation(base.get_dbo(), self.nid)
 def test_get_overdue_donations(self):
     asm3.person.get_overdue_donations(base.get_dbo())
 def test_get_reserves_without_homechecks(self):
     asm3.person.get_reserves_without_homechecks(base.get_dbo())
 def test_get_satellite_counts(self):
     asm3.person.get_satellite_counts(base.get_dbo(), self.nid)
Exemple #45
0
 def test_get_licenses(self):
     financial.get_licences(base.get_dbo())
Exemple #46
0
 def test_get_person_licences(self):
     financial.get_person_licences(base.get_dbo(), 0)
Exemple #47
0
 def test_get_licence(self):
     financial.get_licence(base.get_dbo(), 1)
Exemple #48
0
 def test_get_unpaid_fines(self):
     financial.get_unpaid_fines(base.get_dbo())
 def test_update_anonymise_personal_data(self):
     asm3.person.update_anonymise_personal_data(base.get_dbo(), 1)
 def test_get_person(self):
     asm3.person.get_person(base.get_dbo(), self.nid)
Exemple #51
0
 def test_get_animal_licences(self):
     financial.get_animal_licences(base.get_dbo(), 0)
Exemple #52
0
 def test_get_incident_citations(self):
     financial.get_incident_citations(base.get_dbo(), 0)
Exemple #53
0
 def test_get_person_citations(self):
     financial.get_person_citations(base.get_dbo(), 0)
 def test_get_staff_volunteers(self):
     asm3.person.get_staff_volunteers(base.get_dbo())
Exemple #55
0
 def test_get_animal_donations(self):
     financial.get_animal_donations(base.get_dbo(), 0)
 def test_update_lookingfor_report(self):
     asm3.person.update_lookingfor_report(base.get_dbo())
 def test_update_missing_geocodes(self):
     asm3.person.update_missing_geocodes(base.get_dbo())
 def test_get_person_similar(self):
     assert len(asm3.person.get_person_similar(base.get_dbo(), "", "Testing", "Test", "123 street")) > 0
 def test_get_town_to_county(self):
     asm3.person.get_town_to_county(base.get_dbo())
 def test_get_counties(self):
     asm3.person.get_counties(base.get_dbo())