示例#1
0
    def test_with_changeme(self):
        """Ensure that CHANGEME raises a ValueError."""
        with pytest.raises(ValueError) as exc:
            config._validate_secret('CHANGEME')

        assert str(exc.value
                   ) == 'This setting must be changed from its default value.'
示例#2
0
    def test_with_changeme(self):
        """Ensure that CHANGEME raises a ValueError."""
        with self.assertRaises(ValueError) as exc:
            config._validate_secret('CHANGEME')

        self.assertEqual(
            str(exc.exception),
            'This setting must be changed from its default value.')
示例#3
0
    def test_with_secret(self):
        """Ensure that a secret gets changed to a unicode."""
        result = config._validate_secret('secret')

        assert result == 'secret'
        assert isinstance(result, str)
示例#4
0
    def test_with_secret(self):
        """Ensure that a secret gets changed to a unicode."""
        result = config._validate_secret('secret')

        self.assertEqual(result, u'secret')
        self.assertTrue(isinstance(result, six.text_type))