def test_AdminMachineForm_populates_power_type_initial(self): node = factory.make_Node() form = AdminMachineForm(instance=node) self.assertEqual(node.power_type, form.fields['power_type'].initial)
def test_AdminMachineForm_populates_power_type_choices(self): form = AdminMachineForm() self.assertEqual( [''] + [choice[0] for choice in get_driver_choices()], [choice[0] for choice in form.fields['power_type'].choices])