Пример #1
0
 def test_update(self):
     """Verify the object attributes can be updated using a dict."""
     obj = Activity()
     obj.__dict__.update({"slug": "birding", "name_en": "Birding"})
     obj.save()
Пример #2
0
 def test_name(self):
     """verify the localized name is set once the object is saved."""
     obj = Activity(slug="birding", name_en="Birding")
     obj.save()
     self.assertEqual("Birding", obj.name)
Пример #3
0
 def test_representation(self):
     """Verify the object can be displayed in a foreign key field."""
     obj = Activity(slug="birding", name_en="Birding")
     obj.save()
     self.assertEqual(obj.name, unicode(obj))