コード例 #1
0
ファイル: test_core.py プロジェクト: yogi81/ru
class TestField(TestCase):
    def setUp(self):
        self.field = Field('help')

    def test_init(self):
        self.assertEqual(self.field.help, 'help')

    def test_to_python(self):
        self.assertEqual(self.field.to_python('alpha'), 'alpha')
        self.assertEqual(self.field.to_python(True), True)
        self.assertEqual(self.field.to_python(42), 42)

    def test_from_python(self):
        self.assertEqual(self.field.from_python('alpha'), 'alpha')
        self.assertEqual(self.field.from_python(True), True)
        self.assertEqual(self.field.from_python(42), 42)
コード例 #2
0
ファイル: test_core.py プロジェクト: yogi81/ru
 def setUp(self):
     self.field = Field('help')