Example #1
0
 def test_pack(self):
     t = forms_xso.OptionElement()
     o = t.pack(("foo", "bar"))
     self.assertIsInstance(
         o,
         forms_xso.Option
     )
     self.assertEqual(o.value, "foo")
     self.assertEqual(o.label, "bar")
Example #2
0
 def test_unpack(self):
     t = forms_xso.OptionElement()
     o = forms_xso.Option()
     o.label = "fnord"
     o.value = "foobar"
     self.assertEqual(
         ("foobar", "fnord"),
         t.unpack(o)
     )
Example #3
0
 def test_get_xso_types(self):
     t = forms_xso.OptionElement()
     self.assertCountEqual(
         t.get_xso_types(),
         [forms_xso.Option]
     )
Example #4
0
 def test_get_formatted_type(self):
     t = forms_xso.OptionElement()
     self.assertIs(t.get_formatted_type(), forms_xso.Option)