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.'
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.')
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)
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))