Skip to content

Commit

Permalink
updating unit test to the four new extra fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrasca committed Apr 9, 2018
1 parent 85e798c commit ef2e511
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bauble/plugins/garden/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ def test_init__9_props(self):
o.write()
fields = self.session.query(BaubleMeta).filter(
utils.ilike(BaubleMeta.name, 'inst_%')).all()
self.assertEquals(len(fields), 9) # 9 props define the institution
self.assertEquals(len(fields), 13) # 13 props define the institution

def test_init__one_institution(self):
o = Institution()
Expand All @@ -1697,7 +1697,7 @@ def test_init__one_institution(self):
o.write()
fieldObjects = self.session.query(BaubleMeta).filter(
utils.ilike(BaubleMeta.name, 'inst_%')).all()
self.assertEquals(len(fieldObjects), 9)
self.assertEquals(len(fieldObjects), 13)

def test_init__always_initialized(self):
o = Institution()
Expand Down Expand Up @@ -1803,11 +1803,13 @@ def test_when_user_registers_info_is_logged(self):
o = Institution()
p = InstitutionPresenter(o, view)
p.on_inst_register_clicked()
self.assertEquals(self.handler.messages['bauble.registrations']['info'],
["[('fax', None), ('address', None), ('name', ''), "
"('contact', None), ('technical_contact', None), "
"('abbreviation', None), ('code', None), "
"('tel', None), ('email', '')]"])
print self.handler.messages['bauble.registrations']['info'][0]
target = [('fax', None), ('address', None), ('name', ''),
('contact', None), ('technical_contact', None), ('geo_diameter', None),
('abbreviation', None), ('code', None), ('geo_longitude', None),
('tel', None), ('email', ''), ('geo_latitude', None)]
for i in eval(self.handler.messages['bauble.registrations']['info'][0]):
self.assertTrue(i in target, i)

# latitude: deg[0-90], min[0-59], sec[0-59]
# longitude: deg[0-180], min[0-59], sec[0-59]
Expand Down

0 comments on commit ef2e511

Please sign in to comment.