Loading django/utils/datastructures.py +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class MergeDict(object): return dict_[key] except KeyError: pass raise KeyError raise KeyError(key) def __copy__(self): return self.__class__(*self.dicts) Loading tests/utils_tests/test_datastructures.py +8 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,14 @@ class MergeDictTests(SimpleTestCase): self.assertFalse(empty) self.assertTrue(not_empty) def test_key_error(self): """ Test that the message of KeyError contains the missing key name. """ d1 = MergeDict({'key1': 42}) with six.assertRaisesRegex(self, KeyError, 'key2'): d1['key2'] class MultiValueDictTests(SimpleTestCase): Loading Loading
django/utils/datastructures.py +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class MergeDict(object): return dict_[key] except KeyError: pass raise KeyError raise KeyError(key) def __copy__(self): return self.__class__(*self.dicts) Loading
tests/utils_tests/test_datastructures.py +8 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,14 @@ class MergeDictTests(SimpleTestCase): self.assertFalse(empty) self.assertTrue(not_empty) def test_key_error(self): """ Test that the message of KeyError contains the missing key name. """ d1 = MergeDict({'key1': 42}) with six.assertRaisesRegex(self, KeyError, 'key2'): d1['key2'] class MultiValueDictTests(SimpleTestCase): Loading