summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_util
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-07-20 14:48:51 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-07-22 09:29:54 +0200
commitbdca5ea345c548a82a80d198906818c9ccbef896 (patch)
tree5c3f5fe5ad2522175d67b96a1fce1ff1763ba125 /tests/regressiontests/admin_util
parent3cb2457f46b3e40ff6b6acffcb3fd44cbea091e5 (diff)
[py3] Replaced unicode/str by six.text_type/bytes.
Diffstat (limited to 'tests/regressiontests/admin_util')
-rw-r--r--tests/regressiontests/admin_util/models.py3
-rw-r--r--tests/regressiontests/admin_util/tests.py7
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/regressiontests/admin_util/models.py b/tests/regressiontests/admin_util/models.py
index 0e81df3817..5541097022 100644
--- a/tests/regressiontests/admin_util/models.py
+++ b/tests/regressiontests/admin_util/models.py
@@ -1,4 +1,5 @@
from django.db import models
+from django.utils import six
class Article(models.Model):
@@ -22,7 +23,7 @@ class Count(models.Model):
parent = models.ForeignKey('self', null=True)
def __unicode__(self):
- return unicode(self.num)
+ return six.text_type(self.num)
class Event(models.Model):
date = models.DateTimeField(auto_now_add=True)
diff --git a/tests/regressiontests/admin_util/tests.py b/tests/regressiontests/admin_util/tests.py
index ba2be363ca..6b6dad4336 100644
--- a/tests/regressiontests/admin_util/tests.py
+++ b/tests/regressiontests/admin_util/tests.py
@@ -15,6 +15,7 @@ from django.test import TestCase
from django.utils import unittest
from django.utils.formats import localize
from django.utils.safestring import mark_safe
+from django.utils import six
from .models import Article, Count, Event, Location
@@ -249,17 +250,17 @@ class UtilTests(unittest.TestCase):
log_entry.action_flag = admin.models.ADDITION
self.assertTrue(
- unicode(log_entry).startswith('Added ')
+ six.text_type(log_entry).startswith('Added ')
)
log_entry.action_flag = admin.models.CHANGE
self.assertTrue(
- unicode(log_entry).startswith('Changed ')
+ six.text_type(log_entry).startswith('Changed ')
)
log_entry.action_flag = admin.models.DELETION
self.assertTrue(
- unicode(log_entry).startswith('Deleted ')
+ six.text_type(log_entry).startswith('Deleted ')
)
def test_safestring_in_field_label(self):