def test_save_system_with_node(self): system = System("system") system.create_node("node") system.save() retrieved = System.objects.get(name="system") self.assertEqual(system, retrieved) self.assertEqual(system.nodes, retrieved.nodes) self.assertTrue(retrieved.nodes.has_key("node"))
def test_save_system_without_node(self): system = System("system") system.save() retrieved = System.objects.get(name="system") self.assertEqual(system, retrieved) self.assertEqual(system.name, retrieved.name)