Assert that the JSON fragments raw and expected_data are not equal. Usual JSON non-significant whitespace rules apply as the heavyweight is delegated to the json library.
(self, raw, expected_data, msg=None)
| 1044 | self.assertEqual(data, expected_data, msg=msg) |
| 1045 | |
| 1046 | def assertJSONNotEqual(self, raw, expected_data, msg=None): |
| 1047 | """ |
| 1048 | Assert that the JSON fragments raw and expected_data are not equal. |
| 1049 | Usual JSON non-significant whitespace rules apply as the heavyweight |
| 1050 | is delegated to the json library. |
| 1051 | """ |
| 1052 | try: |
| 1053 | data = json.loads(raw) |
| 1054 | except json.JSONDecodeError: |
| 1055 | self.fail("First argument is not valid JSON: %r" % raw) |
| 1056 | if isinstance(expected_data, str): |
| 1057 | try: |
| 1058 | expected_data = json.loads(expected_data) |
| 1059 | except json.JSONDecodeError: |
| 1060 | self.fail("Second argument is not valid JSON: %r" % expected_data) |
| 1061 | self.assertNotEqual(data, expected_data, msg=msg) |
| 1062 | |
| 1063 | def assertXMLEqual(self, xml1, xml2, msg=None): |
| 1064 | """ |
no test coverage detected