title: How to create a unit test to check the response of an API made in Flask?
body: <p>I'm trying to test a JSON API I implemented in Flask</p>
  
  <p>Here's my view function</p>
  
  <pre><code>@app.route("/dummy")
  def dummy(): 
      return {"dummy":"dummy-value"}
  </code></pre>
  
  <p>And in my Unittest I'm testing using</p>
  
  <pre><code>def setUp(self):
      self.app = my_app.app.test_client()
  
  def test_dummy(self):
       response = self.app.get("/dummy")
       self.assertEqual(response['dummy'], "dummy-value")
  </code></pre>
  
  <p>However, when I ran it, I get the error <code>TypeError: 'dict' object is not callable</code></p>