'Test that the serialized response contains only relevant data.'

@mock.patch(u'requests.post', mock_status_ok)
def test_response_data(self):

    body = {u'id': u'test'}
    url = u'/v1/apps'
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    url = u'/v1/apps/test/builds'.format(**locals())
    body = {u'image': u'autotest/example'}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    for key in response.data:
        self.assertIn(key, [u'uuid', u'owner', u'created', u'updated', u'app', u'dockerfile', u'image', u'procfile', u'sha'])
    expected = {u'owner': self.user.username, u'app': u'test', u'dockerfile': u'', u'image': u'autotest/example', u'procfile': {}, u'sha': u''}
    self.assertDictContainsSubset(expected, response.data)
