Exemplo n.º 1
0
 def test_name(self):
     """verify the localized name is set once the object is saved."""
     obj = SpeciesGroup(
         order='Order', family='Family', genus='Genus', name_en='Group'
     )
     obj.save()
     self.assertEqual('Group', obj.name)
Exemplo n.º 2
0
 def test_representation(self):
     """Verify the object can be displayed in the admin."""
     obj = SpeciesGroup(
         order='Order', family='Family', genus='Genus', name_en='Group'
     )
     obj.save()
     self.assertEqual(u"%s (%s)" % (obj.name, obj.genus), unicode(obj))
Exemplo n.º 3
0
 def test_update(self):
     """Verify the object attributes can be updated using a dict."""
     obj = SpeciesGroup()
     obj.__dict__.update({
         'order': 'Order',
         'family': 'Family',
         'genus': 'Genus',
         'name_en': 'Group',
     })
     obj.save()