      }
  
      def __init__(self, **kwargs):
          super(SlugField, self).__init__(**kwargs)
          slug_regex = re.compile(r'^[-a-zA-Z0-9_]+$')
          validator = RegexValidator(slug_regex, message=self.error_messages['invalid'])
          self.validators.append(validator)
  
  
  class URLField(CharField):
      default_error_messages = {
 
</s> remove     def __init__(self, **kwargs):
 </s> add     def __init__(self, allow_unicode=False, **kwargs): </s> remove         'invalid': _('Enter a valid "slug" consisting of letters, numbers, underscores or hyphens.')
 </s> add         'invalid': _('Enter a valid "slug" consisting of letters, numbers, underscores or hyphens.'),
        'invalid_unicode': _('Enter a valid "slug" consisting of Unicode letters, numbers, underscores, or hyphens.') </s> remove         with open(temp.name, 'rb') as upload:
            name = os.path.basename(upload.name)
            data = client.action(schema, ['encoding', 'multipart'], params={'example': upload})
 </s> add             name = os.path.basename(temp.name)
            data = client.action(schema, ['encoding', 'multipart'], params={'example': temp}) </s> remove         temp = tempfile.NamedTemporaryFile()
        temp.write(b'example file content')
        temp.flush()
 </s> add         with tempfile.NamedTemporaryFile(delete=False) as temp:
            temp.write(b'example file content')
            temp.flush()
            temp.seek(0)
        self.allow_unicode = allow_unicode
        if self.allow_unicode:
            validator = RegexValidator(re.compile(r'^[-\w]+\Z', re.UNICODE), message=self.error_messages['invalid_unicode'])
        else:
            validator = RegexValidator(re.compile(r'^[-a-zA-Z0-9_]+$'), message=self.error_messages['invalid'])
      }
  
      def __init__(self, **kwargs):
          super(SlugField, self).__init__(**kwargs)
        self.allow_unicode = allow_unicode
        if self.allow_unicode:
            validator = RegexValidator(re.compile(r'^[-\w]+\Z', re.UNICODE), message=self.error_messages['invalid_unicode'])
        else:
            validator = RegexValidator(re.compile(r'^[-a-zA-Z0-9_]+$'), message=self.error_messages['invalid'])
        self.allow_unicode = allow_unicode
        if self.allow_unicode:
            validator = RegexValidator(re.compile(r'^[-\w]+\Z', re.UNICODE), message=self.error_messages['invalid_unicode'])
        else:
            validator = RegexValidator(re.compile(r'^[-a-zA-Z0-9_]+$'), message=self.error_messages['invalid'])
          self.validators.append(validator)
  
  
  class URLField(CharField):
      default_error_messages = {
keep keep keep keep replace replace keep keep keep keep keep
 Fixed tests on Windows. Added unicode support to SlugField 
rest_framework/fields.py