'Test that expressions with parameters are updated properly.'

def test_parameter_expressions(self):

    x = Variable()
    y = Variable()
    x0 = Parameter()
    xSquared = ((x0 * x0) + ((2 * x0) * (x - x0)))
    x0.value = 2
    g = (xSquared - y)
    obj = abs((x - 1))
    prob = Problem(Minimize(obj), [(g == 0)])
    prob.solve()
    x0.value = 1
    prob.solve()
    self.assertAlmostEqual(g.value, 0)
    prob = Problem(Minimize((x0 * x)), [(x == 1)])
    x0.value = 2
    prob.solve()
    x0.value = 1
    prob.solve()
    self.assertAlmostEqual(prob.value, 1)
