def test_create_container_with_environment(self):
        saving = self.persistence_service.save(Deployment(
            nodes={
                Node(uuid=self.NODE_A_UUID),
                Node(uuid=self.NODE_B_UUID),
            }
        ))

        environment = {
            u'SITES_ENABLED_PATH': u'/etc/nginx/sites-enabled',
            u'CONFIG_FILE': u'/etc/nginx/nginx.conf',
        }

        saving.addCallback(lambda _: self.assertResponseCode(
            b"POST", b"/configuration/containers",
            {
                u"node_uuid": self.NODE_A, u"name": u"webserver",
                u"image": u"nginx", u"environment": environment
            }, CREATED
        ))

        def created(_):
            deployment = self.persistence_service.get()
            expected = Deployment(
                nodes={
                    Node(
                        uuid=self.NODE_A_UUID,
                        applications=[
                            Application(
                                name='webserver',
                                image=DockerImage.from_string('nginx'),
                                environment=frozenset(environment.items())
                            ),
                        ]
                    ),
                    Node(uuid=self.NODE_B_UUID),
                }
            )
            self.assertEqual(deployment, expected)

        saving.addCallback(created)
        return saving
Loads the given template_name and renders all blocks with the given
dataset/ETHPy150Open ClusterHQ/flocker/flocker/control/test/test_httpapi.py/CreateContainerTestsMixin.test_create_container_with_environment--crossover with--dataset/ETHPy150Open mollyproject/mollyproject/molly/utils/views.py/render_blocks_to_string