def test_to_dict_minimal(self): query = Query('href', 'rel') expected = { 'href': 'href', 'rel': 'rel', } self.assertEqual(query.to_dict(), expected)
def test_to_dict_with_data(self): data = [Data('name')] query = Query('href', 'rel', 'name', 'prompt', data) expected = { 'href': 'href', 'rel': 'rel', 'name': 'name', 'prompt': 'prompt', 'data': [ {'name': 'name'} ] } self.assertEqual(query.to_dict(), expected)