'Test that you cannot directly modify the state'

def test_container_state_protected(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']
    app = App.objects.get(id=app_id)
    user = User.objects.get(username=u'autotest')
    build = Build.objects.create(owner=user, app=app, image=u'qwerty')
    release = Release.objects.create(version=2, owner=user, app=app, config=app.config_set.latest(), build=build)
    c = Container.objects.create(owner=user, app=app, release=release, type=u'web', num=1)
    self.assertRaises(AttributeError, (lambda : setattr(c, u'state', u'up')))
