Ejemplo n.º 1
0
 def test_update(self):
     """Verify the object attributes can be updated using a dict."""
     obj = Direction()
     obj.__dict__.update({
         'slug': 'SE',
         'name_en': 'Southeast',
     })
     obj.save()
Ejemplo n.º 2
0
 def test_name(self):
     """verify the localized name is set once the object is saved."""
     obj = Direction(slug='SE', name_en='Southeast')
     obj.save()
     self.assertEqual('Southeast', obj.name)
Ejemplo n.º 3
0
 def test_representation(self):
     """Verify the object can be displayed in a foreign key field."""
     obj = Direction(slug='SE', name_en='Southeast')
     obj.save()
     self.assertTrue(unicode(obj))