def test_ascii_should_cache_cleaned_string(monkeypatch): s = ascii('mystring') assert s._cache def do_not_call_me(x): assert False monkeypatch.setattr('addok.textutils.default.alphanumerize', do_not_call_me) ascii(s) # Should not call alphanumerize.
def test_ascii_should_clean_string(): s = ascii(u'Aystringé') assert s == 'aystringe'
def test_ascii_should_behave_like_a_string(): s = ascii('mystring') assert str(s) == 'mystring'