title: unittest assertionError in python AssertionError: <Response [200]> != 200
body: <p>I'm writing python tests with unittest and requests modules but getting <br><code>AssertionError: &lt;Response [200]&gt; != 200</code></p>
  
  <p>Tests are setup in two functions, test_get and test_post. Test runners starts from Tests class, where the issue is within test2. I've tried to assert this also: <code>&lt;Response [200]&gt;</code> also. But getting this Error instead: </p>
  
  <pre><code>&lt;Response [200]&gt; != &lt;Response [200]&gt;
  
  Expected :&lt;Response [200]&gt;
  Actual   :&lt;Response [200]&gt;
  </code></pre>
  
  <p>For this I am using httpbin and pycharm. </p>
  
  <pre><code>import requests
  import unittest
  
  # Test 1: Assert get data body
  get_url = 'https://httpbin.org/get'
  test_get = \
      {
          'args': {},
          'headers': {'Accept': '*/*',
                      'Accept-Encoding': 'gzip, deflate',
                      'Host': 'httpbin.org',
                      'User-Agent': 'python-requests/2.21.0'},
          'origin': '94.255.130.105, 94.255.130.105',
          'url': 'https://httpbin.org/get'
      }
  
  def get_httpbin(get_url):
      r = requests.get(get_url).json()
      return r
  
  # Test 2: Assert post is OK 200
  post_url = 'https://httpbin.org/post'
  test_post = \
      {
          'sender': 'Alice',
          'receiver': 'Bob',
          'message': 'We did it!'
      }
  
  def post_httpbin(post_url):
      r = requests.post(post_url, test_post)
      return r
  
  # Test Runner
  class Tests(unittest.TestCase):
      def test1(self):
          self.assertEqual(get_httpbin(get_url), test_get)
  
      def test2(self):
          self.assertEqual(post_httpbin(post_url), 200)
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>