def test_to_python_invalid(self): field = BytesField(name='asdf') field.encoding = 'adsf' with pytest.raises(TypeError): field.to_python(MockConfig(), 'asdf')
def test_to_basic_invalid(self): field = BytesField(name='asdf') field.encoding = 'adsf' with pytest.raises(TypeError): field.to_basic(None, 'asdf')