'Application structures should be valid JSON objects.'

def test_app_structure_is_valid_json(self):

    url = u'/v1/apps'
    response = self.client.post(url, HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    app_id = response.data[u'id']
    self.assertIn(u'structure', response.data)
    self.assertEqual(response.data[u'structure'], {})
    app = App.objects.get(id=app_id)
    app.structure = {u'web': 1}
    app.save()
    url = u'/v1/apps/{}'.format(app_id)
    response = self.client.get(url, HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertIn(u'structure', response.data)
    self.assertEqual(response.data[u'structure'], {u'web': 1})
