'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'}
    response = self.client.post(u'/v1/apps', json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    url = u'/v1/apps/test/config'
    body = {u'values': json.dumps({u'PORT': u'5000'})}
    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'values', u'memory', u'cpu', u'tags'])
    expected = {u'owner': self.user.username, u'app': u'test', u'values': {u'PORT': u'5000'}, u'memory': {}, u'cpu': {}, u'tags': {}}
    self.assertDictContainsSubset(expected, response.data)
