Here are the examples of the python api django.forms.SlugField taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
3
View Complete Implementation : test_slugfield.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
Copyright GNU Affero General Public License v3.0
Author : nesdis
def test_slugfield_unicode_normalization(self):
f = SlugField(allow_unicode=True)
self.astertEqual(f.clean('a'), 'a')
self.astertEqual(f.clean('1'), '1')
self.astertEqual(f.clean('a1'), 'a1')
self.astertEqual(f.clean('你好'), '你好')
self.astertEqual(f.clean(' 你-好 '), '你-好')
self.astertEqual(f.clean('ıçğüş'), 'ıçğüş')
self.astertEqual(f.clean('foo-ıç-bar'), 'foo-ıç-bar')
0
View Complete Implementation : __init__.py
Copyright GNU General Public License v2.0
Author : blackye
Copyright GNU General Public License v2.0
Author : blackye
def formfield(self, **kwargs):
defaults = {'form_clast': forms.SlugField}
defaults.update(kwargs)
return super(SlugField, self).formfield(**defaults)
0
View Complete Implementation : test_converter.py
Copyright MIT License
Author : graphql-python
Copyright MIT License
Author : graphql-python
def test_should_slug_convert_string():
astert_conversion(forms.SlugField, String)
0
View Complete Implementation : test_slugfield.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
Copyright GNU Affero General Public License v3.0
Author : nesdis
def test_slugfield_normalization(self):
f = SlugField()
self.astertEqual(f.clean(' aa-bb-cc '), 'aa-bb-cc')