(self)
| 106 | self.assertEqual(result, MOCK_DATA_DICT) |
| 107 | |
| 108 | def test_roundtrip(self): |
| 109 | field = JSONDictField(use_header=False) |
| 110 | result_to_mongo = field.to_mongo(MOCK_DATA_DICT) |
| 111 | result_to_python = field.to_python(result_to_mongo) |
| 112 | |
| 113 | self.assertEqual(result_to_python, MOCK_DATA_DICT) |
| 114 | |
| 115 | # sets get serialized to a list |
| 116 | input_dict = {"a": 1, "set": {1, 2, 3, 4, 4, 4, 5, 5}} |
| 117 | result = {"a": 1, "set": [1, 2, 3, 4, 5]} |
| 118 | |
| 119 | field = JSONDictField(use_header=False) |
| 120 | result_to_mongo = field.to_mongo(input_dict) |
| 121 | result_to_python = field.to_python(result_to_mongo) |
| 122 | |
| 123 | self.assertEqual(result_to_python, result) |
| 124 | |
| 125 | def test_parse_field_value(self): |
| 126 | # 1. Value not provided, should use default one |
nothing calls this directly
no test coverage detected