コード例 #1
0
    def test_name(self):
        self.assertEqual(PersonStatus.ALIVE.name, six.text_type("ALIVE"))
        self.assertEqual(LabelBeer.STELLA.name, six.text_type("STELLA"))

        # Check that the old classmethod still works. Kept for backward compatibility.
        self.assertEqual(LabelBeer.name(LabelBeer.STELLA.value),
                         six.text_type("STELLA"))
        self.assertEqual(PersonStatus.name("ALIVE"), six.text_type("ALIVE"))
        self.assertEqual(PersonStatus.name(PersonStatus.ALIVE),
                         six.text_type("ALIVE"))
コード例 #2
0
ファイル: test_enum.py プロジェクト: i2biz/django-enumfield
 def test_name(self):
     self.assertEqual(PersonStatus.name(PersonStatus.ALIVE), six.text_type('ALIVE'))
コード例 #3
0
 def test_name(self):
     self.assertEqual(PersonStatus.name(PersonStatus.ALIVE), u'ALIVE')
コード例 #4
0
 def test_name(self):
     self.assertEqual(PersonStatus.name(PersonStatus.ALIVE), six.text_type('ALIVE'))
コード例 #5
0
 def test_name(self):
     self.assertEqual(PersonStatus.name(PersonStatus.ALIVE), u'ALIVE')