'``StartApplication.run()`` passes ``RestartNever`` to
``DockerClient.add`` which is used when creating a Unit.
It doesn\'t pass the ``Application``\ \'s ``restart_policy`` because
``RestartNever`` is the only implemented policy.  See FLOC-2449.'

def test_restart_policy(self):

    policy = RestartAlways()
    fake_docker = FakeDockerClient()
    deployer = ApplicationNodeDeployer(u'example.com', fake_docker)
    application_name = u'site-example.com'
    application = Application(name=application_name, image=DockerImage(repository=u'clusterhq/postgresql', tag=u'9.3.5'), restart_policy=policy)
    StartApplication(application=application, node_state=EMPTY_NODESTATE).run(deployer, state_persister=InMemoryStatePersister())
    [unit] = self.successResultOf(fake_docker.list())
    self.assertEqual(unit.restart_policy, RestartNever())
