Loading

Paste #paucylxwi

  1.     def test_check_general_settings_form_storage(self):
  2.         for route, info in self.forms_by_route_and_info.iteritems():
  3.             # Need to fill data again
  4.             resp = self.layer['browser'].get(self.layer['route_url'](route))
  5.             form = resp.form
  6.             for key, default_value in info.iteritems():
  7.                 form[key] = default_value
  8.             form.submit("submit")
  9.             # Now check for persistence
  10.             root = self.layer['root']
  11.             for key, default_value in info.iteritems():
  12.                 if key == "runs_from" or key == "runs_to":
  13.                     self.assertEqual(date.strftime(getattr(root, key), "%Y-%m-%d"), default_value)
  14.                 else:
  15.                     self.assertEqual(getattr(root, key), default_value)

Comments