Python assertIn test statement not finding string?
<p>I am using <code>assertIn</code> to test that a part of the result in JSON string is correct.</p>

<pre><code>test_json = some_function_returning_a_dict()
self.assertIn(expected_json, test_json, "did not match expected output")
</code></pre>

<p>The error is</p>

<blockquote>
  <p>AssertionError: "'abc': '1.0012'," not found in [{'abc': '1.0012',...</p>
</blockquote>

<p>I used <code>Ctrl + F</code> over the inner string, and it was in the resulting string.<br>
 I'm using Python 3.0</p>

<p>It looks like you are attempting to find a string inside a dictionary, which will check to see if the string you are giving is a key of the specified dictionary. Firstly don't convert your first dictionary to a string, and secondly do something like <code>all(item in test_json.items() for item in expected_json.items())</code></p>

python python-3.x