def METHOD_NAME(self):
    s = Template('$who likes to eat a bag of $what worth $$100')
    self.assertEqual(s.substitute(dict(who='tim', what='ham')),
                     'tim likes to eat a bag of ham worth $100')
    self.assertRaises(KeyError, s.substitute, dict(who='tim'))