          elif safe_input:
              words[i] = mark_safe(word)
          elif autoescape:
              words[i] = escape(word)
      return mark_safe(u''.join(words))
 
</s> remove         elif hasattr(value, '__iter__') and not isinstance(value, (dict, basestring)):
 </s> add         elif hasattr(value, '__iter__') and not isinstance(value, (dict, six.string_types)): </s> remove         return smart_unicode(value)
 </s> add         return smart_text(value) </s> remove     if isinstance(val, basestring):
 </s> add     if isinstance(val, string_types): </s> remove                     userid = smart_unicode(auth_parts[0])
                    password = smart_unicode(auth_parts[2])
 </s> add                     userid = smart_text(auth_parts[0])
                    password = smart_text(auth_parts[2]) </s> remove         return u"%s(%s);" % (callback, json)
 </s> add         return "%s(%s);" % (callback, json)
    return mark_safe(''.join(words))
          elif safe_input:
              words[i] = mark_safe(word)
          elif autoescape:
              words[i] = escape(word)
    return mark_safe(''.join(words))
keep keep keep keep replace
 First passing test under p3k \o/ 
rest_framework/templatetags/rest_framework.py