Browse Source

Remove u prefix from strings

rafalp 6 years ago
parent
commit
cb0cf5717e

+ 4 - 4
misago/core/apipatch.py

@@ -98,16 +98,16 @@ class ApiPatch(object):
 
 
     def validate_action(self, action):
     def validate_action(self, action):
         if not action.get('op'):
         if not action.get('op'):
-            raise InvalidAction(u"undefined op")
+            raise InvalidAction("undefined op")
 
 
         if action.get('op') not in ALLOWED_OPS:
         if action.get('op') not in ALLOWED_OPS:
-            raise InvalidAction(u'"%s" op is unsupported' % action.get('op'))
+            raise InvalidAction('"%s" op is unsupported' % action.get('op'))
 
 
         if not action.get('path'):
         if not action.get('path'):
-            raise InvalidAction(u'"%s" op has to specify path' % action.get('op'))
+            raise InvalidAction('"%s" op has to specify path' % action.get('op'))
 
 
         if 'value' not in action:
         if 'value' not in action:
-            raise InvalidAction(u'"%s" op has to specify value' % action.get('op'))
+            raise InvalidAction('"%s" op has to specify value' % action.get('op'))
 
 
     def dispatch_action(self, patch, request, target, action):
     def dispatch_action(self, patch, request, target, action):
         for handler in self._actions:
         for handler in self._actions:

+ 1 - 1
misago/core/templatetags/misago_absoluteurl.py

@@ -20,4 +20,4 @@ def absoluteurl(url_or_name, *args, **kwargs):
         if not url_or_name.startswith('/'):
         if not url_or_name.startswith('/'):
             return url_or_name
             return url_or_name
     
     
-    return u'{}{}'.format(absolute_url_prefix, url_or_name)
+    return '{}{}'.format(absolute_url_prefix, url_or_name)

+ 2 - 2
misago/core/templatetags/misago_pagetitle.py

@@ -8,9 +8,9 @@ register = template.Library()
 @register.simple_tag
 @register.simple_tag
 def pagetitle(title, **kwargs):
 def pagetitle(title, **kwargs):
     if 'page' in kwargs and kwargs['page'] > 1:
     if 'page' in kwargs and kwargs['page'] > 1:
-        title += u" (%s)" % (_(u"page: %(page)s") % {'page': kwargs['page']})
+        title += " (%s)" % (_("page: %(page)s") % {'page': kwargs['page']})
 
 
     if 'parent' in kwargs:
     if 'parent' in kwargs:
-        title += u" | %s" % kwargs['parent']
+        title += " | %s" % kwargs['parent']
 
 
     return title
     return title

+ 1 - 1
misago/core/testproject/searchfilters.py

@@ -1,2 +1,2 @@
 def test_filter(search):
 def test_filter(search):
-    return search.replace(u'MMM', u'Marines, Marauders and Medics')
+    return search.replace('MMM', 'Marines, Marauders and Medics')

+ 5 - 5
misago/core/tests/test_apipatch.py

@@ -91,19 +91,19 @@ class ApiPatchTests(TestCase):
             try:
             try:
                 patch.validate_action(action)
                 patch.validate_action(action)
             except InvalidAction as e:
             except InvalidAction as e:
-                self.assertEqual(e.args[0], u"undefined op")
+                self.assertEqual(e.args[0], "undefined op")
 
 
         # unsupported op
         # unsupported op
         try:
         try:
             patch.validate_action({'op': 'nope'})
             patch.validate_action({'op': 'nope'})
         except InvalidAction as e:
         except InvalidAction as e:
-            self.assertEqual(e.args[0], u'"nope" op is unsupported')
+            self.assertEqual(e.args[0], '"nope" op is unsupported')
 
 
         # op lacking patch
         # op lacking patch
         try:
         try:
             patch.validate_action({'op': 'add'})
             patch.validate_action({'op': 'add'})
         except InvalidAction as e:
         except InvalidAction as e:
-            self.assertEqual(e.args[0], u'"add" op has to specify path')
+            self.assertEqual(e.args[0], '"add" op has to specify path')
 
 
         # op lacking value
         # op lacking value
         try:
         try:
@@ -112,7 +112,7 @@ class ApiPatchTests(TestCase):
                 'path': 'yolo',
                 'path': 'yolo',
             })
             })
         except InvalidAction as e:
         except InvalidAction as e:
-            self.assertEqual(e.args[0], u'"add" op has to specify value')
+            self.assertEqual(e.args[0], '"add" op has to specify value')
 
 
         # empty value is allowed
         # empty value is allowed
         try:
         try:
@@ -122,7 +122,7 @@ class ApiPatchTests(TestCase):
                 'value': '',
                 'value': '',
             })
             })
         except InvalidAction as e:
         except InvalidAction as e:
-            self.assertEqual(e.args[0], u'"add" op has to specify value')
+            self.assertEqual(e.args[0], '"add" op has to specify value')
 
 
     def test_dispatch_action(self):
     def test_dispatch_action(self):
         """dispatch_action calls specified actions"""
         """dispatch_action calls specified actions"""

+ 1 - 1
misago/core/tests/test_forms.py

@@ -23,6 +23,6 @@ class YesNoSwitchTests(TestCase):
 
 
     def test_dontstripme_input_is_ignored(self):
     def test_dontstripme_input_is_ignored(self):
         """YesNoSwitch returns valid values for invalid input"""
         """YesNoSwitch returns valid values for invalid input"""
-        form = YesNoForm({'test_field': u'221'})
+        form = YesNoForm({'test_field': '221'})
         form.full_clean()
         form.full_clean()
         self.assertFalse(form.cleaned_data.get('test_field'))
         self.assertFalse(form.cleaned_data.get('test_field'))

+ 1 - 1
misago/markup/mentions.py

@@ -59,7 +59,7 @@ def parse_string(request, element, mentions_dict):
 
 
         if mentions_dict[username]:
         if mentions_dict[username]:
             user = mentions_dict[username]
             user = mentions_dict[username]
-            return u'<a href="{}">@{}</a>'.format(user.get_absolute_url(), user.username)
+            return '<a href="{}">@{}</a>'.format(user.get_absolute_url(), user.username)
         else:
         else:
             # we've failed to resolve user for username
             # we've failed to resolve user for username
             return matchobj.group(0)
             return matchobj.group(0)

+ 1 - 1
misago/threads/mergeconflict.py

@@ -75,7 +75,7 @@ class PollMergeHandler(MergeConflictHandler):
     def get_available_resolutions(self):
     def get_available_resolutions(self):
         resolutions = [[0, _("Delete all polls")]]
         resolutions = [[0, _("Delete all polls")]]
         for poll in self.items:
         for poll in self.items:
-            resolutions.append([poll.id, u'{} ({})'.format(poll.question, poll.thread.title)])
+            resolutions.append([poll.id, '{} ({})'.format(poll.question, poll.thread.title)])
         return resolutions
         return resolutions
 
 
 
 

+ 1 - 1
misago/threads/signals.py

@@ -175,7 +175,7 @@ def archive_user_polls(sender, archive=None, **kwargs):
             item_name,
             item_name,
             OrderedDict([
             OrderedDict([
                 (_("Question"), poll.question),
                 (_("Question"), poll.question),
-                (_("Choices"), u', '.join([c['label'] for c in poll.choices])),
+                (_("Choices"), ', '.join([c['label'] for c in poll.choices])),
             ]),
             ]),
             date=poll.posted_on,
             date=poll.posted_on,
         )
         )

+ 2 - 2
misago/threads/tests/test_mergeconflict.py

@@ -174,7 +174,7 @@ class MergeConflictTests(TestCase):
                 'polls': [['0', 'Delete all polls']] + [
                 'polls': [['0', 'Delete all polls']] + [
                     [
                     [
                         str(thread.poll.id),
                         str(thread.poll.id),
-                        u'{} ({})'.format(thread.poll.question, thread.title),
+                        '{} ({})'.format(thread.poll.question, thread.title),
                     ] for thread in polls
                     ] for thread in polls
                 ]
                 ]
             })
             })
@@ -238,7 +238,7 @@ class MergeConflictTests(TestCase):
                 'polls': [['0', 'Delete all polls']] + [
                 'polls': [['0', 'Delete all polls']] + [
                     [
                     [
                         str(thread.poll.id),
                         str(thread.poll.id),
-                        u'{} ({})'.format(thread.poll.question, thread.title),
+                        '{} ({})'.format(thread.poll.question, thread.title),
                     ] for thread in polls
                     ] for thread in polls
                 ]
                 ]
             })
             })

+ 2 - 2
misago/threads/tests/test_thread_merge_api.py

@@ -708,11 +708,11 @@ class ThreadMergeApiTests(ThreadsApiTestCase):
                     ['0', "Delete all polls"],
                     ['0', "Delete all polls"],
                     [
                     [
                         str(poll.pk),
                         str(poll.pk),
-                        u'{} ({})'.format(poll.question, poll.thread.title),
+                        '{} ({})'.format(poll.question, poll.thread.title),
                     ],
                     ],
                     [
                     [
                         str(other_poll.pk),
                         str(other_poll.pk),
-                        u'{} ({})'.format(other_poll.question, other_poll.thread.title),
+                        '{} ({})'.format(other_poll.question, other_poll.thread.title),
                     ],
                     ],
                 ]
                 ]
             }
             }

+ 2 - 2
misago/threads/tests/test_threads_merge_api.py

@@ -1065,11 +1065,11 @@ class ThreadsMergeApiTests(ThreadsApiTestCase):
                     ['0', "Delete all polls"],
                     ['0', "Delete all polls"],
                     [
                     [
                         str(other_poll.pk),
                         str(other_poll.pk),
-                        u'{} ({})'.format(other_poll.question, other_poll.thread.title),
+                        '{} ({})'.format(other_poll.question, other_poll.thread.title),
                     ],
                     ],
                     [
                     [
                         str(poll.pk),
                         str(poll.pk),
-                        u'{} ({})'.format(poll.question, poll.thread.title),
+                        '{} ({})'.format(poll.question, poll.thread.title),
                     ],
                     ],
                 ],
                 ],
             }
             }

+ 2 - 2
misago/threads/tests/test_threadslists.py

@@ -161,10 +161,10 @@ class ThreadsListTestCase(AuthenticatedUserTestCase):
         return categories_acl
         return categories_acl
 
 
     def assertContainsThread(self, response, thread):
     def assertContainsThread(self, response, thread):
-        self.assertContains(response, u' href="{}"'.format(thread.get_absolute_url()))
+        self.assertContains(response, ' href="{}"'.format(thread.get_absolute_url()))
 
 
     def assertNotContainsThread(self, response, thread):
     def assertNotContainsThread(self, response, thread):
-        self.assertNotContains(response, u' href="{}"'.format(thread.get_absolute_url()))
+        self.assertNotContains(response, ' href="{}"'.format(thread.get_absolute_url()))
 
 
 
 
 class ApiTests(ThreadsListTestCase):
 class ApiTests(ThreadsListTestCase):

+ 7 - 7
misago/threads/tests/test_threadview.py

@@ -527,7 +527,7 @@ class ThreadAnonViewTests(ThreadViewTestCase):
 class ThreadUnicodeSupportTests(ThreadViewTestCase):
 class ThreadUnicodeSupportTests(ThreadViewTestCase):
     def test_category_name(self):
     def test_category_name(self):
         """unicode in category name causes no showstopper"""
         """unicode in category name causes no showstopper"""
-        self.category.name = u'Łódź'
+        self.category.name = 'Łódź'
         self.category.slug = 'Lodz'
         self.category.slug = 'Lodz'
 
 
         self.category.save()
         self.category.save()
@@ -539,7 +539,7 @@ class ThreadUnicodeSupportTests(ThreadViewTestCase):
 
 
     def test_thread_title(self):
     def test_thread_title(self):
         """unicode in thread title causes no showstopper"""
         """unicode in thread title causes no showstopper"""
-        self.thread.title = u'Łódź'
+        self.thread.title = 'Łódź'
         self.thread.slug = 'Lodz'
         self.thread.slug = 'Lodz'
 
 
         self.thread.save()
         self.thread.save()
@@ -551,8 +551,8 @@ class ThreadUnicodeSupportTests(ThreadViewTestCase):
 
 
     def test_post_content(self):
     def test_post_content(self):
         """unicode in thread title causes no showstopper"""
         """unicode in thread title causes no showstopper"""
-        self.thread.first_post.original = u'Łódź'
-        self.thread.first_post.parsed = u'<p>Łódź</p>'
+        self.thread.first_post.original = 'Łódź'
+        self.thread.first_post.parsed = '<p>Łódź</p>'
 
 
         update_post_checksum(self.thread.first_post)
         update_post_checksum(self.thread.first_post)
 
 
@@ -565,9 +565,9 @@ class ThreadUnicodeSupportTests(ThreadViewTestCase):
 
 
     def test_user_rank(self):
     def test_user_rank(self):
         """unicode in user rank causes no showstopper"""
         """unicode in user rank causes no showstopper"""
-        self.user.title = u'Łódź'
-        self.user.rank.name = u'Łódź'
-        self.user.rank.title = u'Łódź'
+        self.user.title = 'Łódź'
+        self.user.rank.name = 'Łódź'
+        self.user.rank.title = 'Łódź'
 
 
         self.user.rank.save()
         self.user.rank.save()
         self.user.save()
         self.user.save()

+ 4 - 4
misago/users/datadownloads/dataarchive.py

@@ -85,8 +85,8 @@ class DataArchive(object):
     def add_dict(self, name, value, date=None, directory=None):
     def add_dict(self, name, value, date=None, directory=None):
         text_lines = []
         text_lines = []
         for key, value in value.items():
         for key, value in value.items():
-            text_lines.append(u"{}: {}".format(key, value))
-        text = u'\n'.join(text_lines)
+            text_lines.append("{}: {}".format(key, value))
+        text = '\n'.join(text_lines)
         return self.add_text(name, text, date=date, directory=directory)
         return self.add_text(name, text, date=date, directory=directory)
 
 
     def add_model_file(self, model_file, prefix=None, date=None, directory=None):
     def add_model_file(self, model_file, prefix=None, date=None, directory=None):
@@ -97,7 +97,7 @@ class DataArchive(object):
 
 
         filename = os.path.basename(model_file.name)
         filename = os.path.basename(model_file.name)
         if prefix:
         if prefix:
-            prefixed_filename = u"{}-{}".format(prefix, filename)
+            prefixed_filename = "{}-{}".format(prefix, filename)
             clean_filename = trim_long_filename(prefixed_filename)
             clean_filename = trim_long_filename(prefixed_filename)
             target_path = os.path.join(target_dir_path, clean_filename)
             target_path = os.path.join(target_dir_path, clean_filename)
         else:
         else:
@@ -153,4 +153,4 @@ def trim_long_filename(filename):
 
 
     name, extension = os.path.splitext(filename)
     name, extension = os.path.splitext(filename)
     name_len = FILENAME_MAX_LEN - len(extension)
     name_len = FILENAME_MAX_LEN - len(extension)
-    return u'{}{}'.format(name[:name_len], extension)
+    return '{}{}'.format(name[:name_len], extension)

+ 5 - 5
misago/users/management/commands/createsuperuser.py

@@ -85,7 +85,7 @@ class Command(BaseCommand):
                 username = username.strip()
                 username = username.strip()
                 validate_username(username)
                 validate_username(username)
             except ValidationError as e:
             except ValidationError as e:
-                self.stderr.write(u'\n'.join(e.messages))
+                self.stderr.write('\n'.join(e.messages))
                 username = None
                 username = None
 
 
         if email is not None:
         if email is not None:
@@ -93,7 +93,7 @@ class Command(BaseCommand):
                 email = email.strip()
                 email = email.strip()
                 validate_email(email)
                 validate_email(email)
             except ValidationError as e:
             except ValidationError as e:
-                self.stderr.write(u'\n'.join(e.messages))
+                self.stderr.write('\n'.join(e.messages))
                 email = None
                 email = None
 
 
         if password is not None:
         if password is not None:
@@ -120,7 +120,7 @@ class Command(BaseCommand):
                         validate_username(raw_value)
                         validate_username(raw_value)
                         username = raw_value
                         username = raw_value
                     except ValidationError as e:
                     except ValidationError as e:
-                        self.stderr.write(u'\n'.join(e.messages))
+                        self.stderr.write('\n'.join(e.messages))
 
 
                 while not email:
                 while not email:
                     try:
                     try:
@@ -128,7 +128,7 @@ class Command(BaseCommand):
                         validate_email(raw_value)
                         validate_email(raw_value)
                         email = raw_value
                         email = raw_value
                     except ValidationError as e:
                     except ValidationError as e:
-                        self.stderr.write(u'\n'.join(e.messages))
+                        self.stderr.write('\n'.join(e.messages))
 
 
                 while not password:
                 while not password:
                     raw_value = getpass("Enter password: ")
                     raw_value = getpass("Enter password: ")
@@ -146,7 +146,7 @@ class Command(BaseCommand):
                             raw_value, user=UserModel(username=username, email=email)
                             raw_value, user=UserModel(username=username, email=email)
                         )
                         )
                     except ValidationError as e:
                     except ValidationError as e:
-                        self.stderr.write(u'\n'.join(e.messages))
+                        self.stderr.write('\n'.join(e.messages))
                         response = input('Bypass password validation and create user anyway? [y/N]: ')
                         response = input('Bypass password validation and create user anyway? [y/N]: ')
                         if response.lower() != 'y':
                         if response.lower() != 'y':
                             continue
                             continue

+ 1 - 1
misago/users/tests/test_auth_views.py

@@ -67,7 +67,7 @@ class AuthViewsTests(TestCase):
         response = self.client.post(
         response = self.client.post(
             reverse('misago:login'),
             reverse('misago:login'),
             data={
             data={
-                'redirect_to': u'łelcome!',
+                'redirect_to': 'łelcome!',
             },
             },
         )
         )
 
 

+ 6 - 6
misago/users/tests/test_datadownloads_dataarchive.py

@@ -55,7 +55,7 @@ class DataArchiveTests(AuthenticatedUserTestCase):
     def test_add_text_str(self):
     def test_add_text_str(self):
         """add_dict method creates text file with string"""
         """add_dict method creates text file with string"""
         with DataArchive(self.user, DATA_DOWNLOADS_WORKING_DIR) as archive:
         with DataArchive(self.user, DATA_DOWNLOADS_WORKING_DIR) as archive:
-            data_to_write = u"Hello, łorld!"
+            data_to_write = "Hello, łorld!"
             file_path = archive.add_text('testfile', data_to_write)
             file_path = archive.add_text('testfile', data_to_write)
             self.assertTrue(os.path.isfile(file_path))
             self.assertTrue(os.path.isfile(file_path))
 
 
@@ -83,7 +83,7 @@ class DataArchiveTests(AuthenticatedUserTestCase):
     def test_add_dict(self):
     def test_add_dict(self):
         """add_dict method creates text file from dict"""
         """add_dict method creates text file from dict"""
         with DataArchive(self.user, DATA_DOWNLOADS_WORKING_DIR) as archive:
         with DataArchive(self.user, DATA_DOWNLOADS_WORKING_DIR) as archive:
-            data_to_write = {'first': u"łorld!", 'second': u"łup!"}
+            data_to_write = {'first': "łorld!", 'second': "łup!"}
             file_path = archive.add_dict('testfile', data_to_write)
             file_path = archive.add_dict('testfile', data_to_write)
             self.assertTrue(os.path.isfile(file_path))
             self.assertTrue(os.path.isfile(file_path))
 
 
@@ -94,13 +94,13 @@ class DataArchiveTests(AuthenticatedUserTestCase):
                 saved_data = fp.read().strip()
                 saved_data = fp.read().strip()
                 # order of dict items in py<3.6 is non-deterministic
                 # order of dict items in py<3.6 is non-deterministic
                 # making testing for exact match a mistake
                 # making testing for exact match a mistake
-                self.assertIn(u"first: łorld!", saved_data)
-                self.assertIn(u"second: łup!", saved_data)
+                self.assertIn("first: łorld!", saved_data)
+                self.assertIn("second: łup!", saved_data)
 
 
     def test_add_dict_ordered(self):
     def test_add_dict_ordered(self):
         """add_dict method creates text file form ordered dict"""
         """add_dict method creates text file form ordered dict"""
         with DataArchive(self.user, DATA_DOWNLOADS_WORKING_DIR) as archive:
         with DataArchive(self.user, DATA_DOWNLOADS_WORKING_DIR) as archive:
-            data_to_write = OrderedDict((('first', u"łorld!"), ('second', u"łup!")))
+            data_to_write = OrderedDict((('first', "łorld!"), ('second', "łup!")))
             file_path = archive.add_dict('testfile', data_to_write)
             file_path = archive.add_dict('testfile', data_to_write)
             self.assertTrue(os.path.isfile(file_path))
             self.assertTrue(os.path.isfile(file_path))
 
 
@@ -109,7 +109,7 @@ class DataArchiveTests(AuthenticatedUserTestCase):
 
 
             with io.open(file_path, 'r', encoding="utf-8") as fp:
             with io.open(file_path, 'r', encoding="utf-8") as fp:
                 saved_data = fp.read().strip()
                 saved_data = fp.read().strip()
-                self.assertEqual(saved_data, u"first: łorld!\nsecond: łup!")
+                self.assertEqual(saved_data, "first: łorld!\nsecond: łup!")
 
 
     def test_add_model_file(self):
     def test_add_model_file(self):
         """add_model_file method adds model file"""
         """add_model_file method adds model file"""

+ 7 - 7
misago/users/tests/test_social_pipeline.py

@@ -579,14 +579,14 @@ class GetUsernameTests(PipelineTestCase):
 
 
     def test_normalize_username(self):
     def test_normalize_username(self):
         """pipeline step normalizes username"""
         """pipeline step normalizes username"""
-        result = get_username(None, {'username': u'Błop Błoperson'}, None)
+        result = get_username(None, {'username': 'Błop Błoperson'}, None)
         self.assertEqual(result, {'clean_username': 'BlopBloperson'})
         self.assertEqual(result, {'clean_username': 'BlopBloperson'})
 
 
     def test_resolve_to_first_name(self):
     def test_resolve_to_first_name(self):
         """pipeline attempts to use first name because username is taken"""
         """pipeline attempts to use first name because username is taken"""
         details = {
         details = {
             'username': self.user.username,
             'username': self.user.username,
-            'first_name': u'Błob',
+            'first_name': 'Błob',
         }
         }
         result = get_username(None, details, None)
         result = get_username(None, details, None)
         self.assertEqual(result, {'clean_username': 'Blob'})
         self.assertEqual(result, {'clean_username': 'Blob'})
@@ -595,7 +595,7 @@ class GetUsernameTests(PipelineTestCase):
         """pipeline will not fallback to last name because username is taken"""
         """pipeline will not fallback to last name because username is taken"""
         details = {
         details = {
             'username': self.user.username,
             'username': self.user.username,
-            'last_name': u'Błob',
+            'last_name': 'Błob',
         }
         }
         result = get_username(None, details, None)
         result = get_username(None, details, None)
         self.assertIsNone(result)
         self.assertIsNone(result)
@@ -604,7 +604,7 @@ class GetUsernameTests(PipelineTestCase):
         """pipeline will construct username from first name and first char of surname"""
         """pipeline will construct username from first name and first char of surname"""
         details = {
         details = {
             'first_name': self.user.username,
             'first_name': self.user.username,
-            'last_name': u'Błob',
+            'last_name': 'Błob',
         }
         }
         result = get_username(None, details, None)
         result = get_username(None, details, None)
         self.assertEqual(result, {'clean_username': self.user.username + 'B'})
         self.assertEqual(result, {'clean_username': self.user.username + 'B'})
@@ -614,7 +614,7 @@ class GetUsernameTests(PipelineTestCase):
         Ban.objects.create(banned_value='*Admin*', check_type=Ban.USERNAME)
         Ban.objects.create(banned_value='*Admin*', check_type=Ban.USERNAME)
         details = {
         details = {
             'username': 'Misago Admin',
             'username': 'Misago Admin',
-            'first_name': u'Błob',
+            'first_name': 'Błob',
         }
         }
         result = get_username(None, details, None)
         result = get_username(None, details, None)
         self.assertEqual(result, {'clean_username': 'Blob'})
         self.assertEqual(result, {'clean_username': 'Blob'})
@@ -624,7 +624,7 @@ class GetUsernameTests(PipelineTestCase):
         Ban.objects.create(banned_value='*Admin*', check_type=Ban.USERNAME)
         Ban.objects.create(banned_value='*Admin*', check_type=Ban.USERNAME)
         details = {
         details = {
             'username': 'Misago Admin',
             'username': 'Misago Admin',
-            'full_name': u'Błob Błopo',
+            'full_name': 'Błob Błopo',
         }
         }
         result = get_username(None, details, None)
         result = get_username(None, details, None)
         self.assertEqual(result, {'clean_username': 'BlobBlopo'})
         self.assertEqual(result, {'clean_username': 'BlobBlopo'})
@@ -632,7 +632,7 @@ class GetUsernameTests(PipelineTestCase):
     def test_resolve_to_cut_name(self):
     def test_resolve_to_cut_name(self):
         """pipeline will resolve cut too long name on second pass"""
         """pipeline will resolve cut too long name on second pass"""
         details = {
         details = {
-            'username': u'Abrakadabrapokuskonstantynopolitańczykowianeczkatrzy',
+            'username': 'Abrakadabrapokuskonstantynopolitańczykowianeczkatrzy',
         }
         }
         result = get_username(None, details, None)
         result = get_username(None, details, None)
         self.assertEqual(result, {'clean_username': 'Abrakadabrapok'})
         self.assertEqual(result, {'clean_username': 'Abrakadabrapok'})

+ 3 - 3
misago/users/tests/test_user_model.py

@@ -74,13 +74,13 @@ class UserManagerTests(TestCase):
     def test_getters_unicode_handling(self):
     def test_getters_unicode_handling(self):
         """get_by_ methods handle unicode"""
         """get_by_ methods handle unicode"""
         with self.assertRaises(User.DoesNotExist):
         with self.assertRaises(User.DoesNotExist):
-            User.objects.get_by_username(u'łóć')
+            User.objects.get_by_username('łóć')
 
 
         with self.assertRaises(User.DoesNotExist):
         with self.assertRaises(User.DoesNotExist):
-            User.objects.get_by_email(u'łóć@polskimail.pl')
+            User.objects.get_by_email('łóć@polskimail.pl')
 
 
         with self.assertRaises(User.DoesNotExist):
         with self.assertRaises(User.DoesNotExist):
-            User.objects.get_by_username_or_email(u'łóć@polskimail.pl')
+            User.objects.get_by_username_or_email('łóć@polskimail.pl')
 
 
 
 
 class UserModelTests(TestCase):
 class UserModelTests(TestCase):

+ 1 - 1
misago/users/tests/test_utils.py

@@ -10,4 +10,4 @@ class HashEmailTests(TestCase):
 
 
     def test_handles_unicode(self):
     def test_handles_unicode(self):
         """util works with unicode strings"""
         """util works with unicode strings"""
-        self.assertEqual(hash_email(u'łóć@test.com'), hash_email(u'ŁÓĆ@tEst.cOm'))
+        self.assertEqual(hash_email('łóć@test.com'), hash_email('ŁÓĆ@tEst.cOm'))

+ 2 - 2
misago/users/tests/test_validators.py

@@ -109,9 +109,9 @@ class ValidateUsernameContentTests(TestCase):
         with self.assertRaises(ValidationError):
         with self.assertRaises(ValidationError):
             validate_username_content('Bob Boberson')
             validate_username_content('Bob Boberson')
         with self.assertRaises(ValidationError):
         with self.assertRaises(ValidationError):
-            validate_username_content(u'Rafał')
+            validate_username_content('Rafał')
         with self.assertRaises(ValidationError):
         with self.assertRaises(ValidationError):
-            validate_username_content(u'初音 ミク')
+            validate_username_content('初音 ミク')
 
 
 
 
 class ValidateUsernameLengthTests(TestCase):
 class ValidateUsernameLengthTests(TestCase):

+ 1 - 1
misago/users/validators.py

@@ -100,7 +100,7 @@ def validate_username(value, exclude=None):
 
 
 
 
 # New account validators
 # New account validators
-SFS_API_URL = u'http://api.stopforumspam.org/api?email=%(email)s&ip=%(ip)s&f=json&confidence'  # noqa
+SFS_API_URL = 'http://api.stopforumspam.org/api?email=%(email)s&ip=%(ip)s&f=json&confidence'  # noqa
 
 
 
 
 def validate_with_sfs(request, cleaned_data, add_error):
 def validate_with_sfs(request, cleaned_data, add_error):

+ 3 - 3
misago/users/views/auth.py

@@ -24,10 +24,10 @@ def login(request):
             if is_redirect_safe:
             if is_redirect_safe:
                 redirect_to_path = urlparse(redirect_to).path
                 redirect_to_path = urlparse(redirect_to).path
                 if '?' not in redirect_to_path:
                 if '?' not in redirect_to_path:
-                    redirect_to_path = u'{}?'.format(redirect_to_path)
+                    redirect_to_path = '{}?'.format(redirect_to_path)
                 else:
                 else:
-                    redirect_to_path = u'{}&'.format(redirect_to_path)
-                redirect_to_path = u'{}ref=login'.format(redirect_to_path)
+                    redirect_to_path = '{}&'.format(redirect_to_path)
+                redirect_to_path = '{}ref=login'.format(redirect_to_path)
                 try:
                 try:
                     return redirect(redirect_to_path)
                     return redirect(redirect_to_path)
                 except NoReverseMatch:
                 except NoReverseMatch: