def test_convert_to_list_dict(self): self.assertIsNone(utils.convert_to_list_dict(None, 'fred')) self.assertIsNone(utils.convert_to_list_dict('', 'fred')) self.assertEqual([{'fred': 'list'}], utils.convert_to_list_dict('list', 'fred')) self.assertEqual([{'fred': 'first'}, {'fred': 'second'}], utils.convert_to_list_dict(['first', 'second'], 'fred'))