def test_get_ipmi_none(self): serializer = EquipmentSerializer() ipmi = { 'IPMI Hostname': None, 'IPMI Mac': None } self.assertEqual(ipmi, serializer.get_ipmi(None))
def test_get_ipmi_nonexistent(self): equipment = Equipment.objects.get(serial='R123457') serializer = EquipmentSerializer() ipmi = { 'IPMI Hostname': None, 'IPMI Mac': None } self.assertEqual(ipmi, serializer.get_ipmi(equipment))
def test_get_ipmi_existent(self): equipment = Equipment.objects.get(serial='G123456') serializer = EquipmentSerializer() ipmi = { 'IPMI Hostname': equipment.servermanagement.hostname, 'IPMI Mac': equipment.servermanagement.mac } self.assertEqual(ipmi, serializer.get_ipmi(equipment))