def test_container_state_protected(self):
        url = '/v1/apps'
        response = self.client.post(url, HTTP_AUTHORIZATION='token {}'.format(self.token))
        self.assertEqual(response.status_code, 201)
        app_id = response.data['id']
        app = App.objects.get(id=app_id)
        user = User.objects.get(username='autotest')
        build = Build.objects.create(owner=user, app=app, image="qwerty")
        # create an initial release
        release = Release.objects.create(version=2,
                                         owner=user,
                                         app=app,
                                         config=app.config_set.latest(),
                                         build=build)
        # create a container
        c = Container.objects.create(owner=user,
                                     app=app,
                                     release=release,
                                     type='web',
                                     num=1)
        self.assertRaises(AttributeError, lambda: setattr(c, 'state', 'up'))
Create a new OEmbedEndpoint object.
dataset/ETHPy150Open deis/deis/controller/api/tests/test_container.py/ContainerTest.test_container_state_protected--crossover with--dataset/ETHPy150Open abarmat/python-oembed/oembed/__init__.py/OEmbedEndpoint.__init__