Skip to content

Commit

Permalink
Fix repr tests for Python 2 (no string comparison)
Browse files Browse the repository at this point in the history
  • Loading branch information
treyhunner committed Apr 9, 2013
1 parent 47f6dd6 commit 9c207e5
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions model_utils/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def test_len(self):


def test_repr(self):
self.assertEquals(repr(self.STATUS),
"Choices("
"('DRAFT', 'DRAFT', 'DRAFT'), "
"('PUBLISHED', 'PUBLISHED', 'PUBLISHED'))")
self.assertEquals(repr(self.STATUS), "Choices" + repr((
('DRAFT', 'DRAFT', 'DRAFT'),
('PUBLISHED', 'PUBLISHED', 'PUBLISHED'),
)))


def test_wrong_length_tuple(self):
Expand Down Expand Up @@ -244,11 +244,11 @@ def test_len(self):


def test_repr(self):
self.assertEquals(repr(self.STATUS),
"Choices("
"('DRAFT', 'DRAFT', 'is draft'), "
"('PUBLISHED', 'PUBLISHED', 'is published'), "
"('DELETED', 'DELETED', 'DELETED'))")
self.assertEquals(repr(self.STATUS), "Choices" + repr((
('DRAFT', 'DRAFT', 'is draft'),
('PUBLISHED', 'PUBLISHED', 'is published'),
('DELETED', 'DELETED', 'DELETED'),
)))



Expand Down Expand Up @@ -280,12 +280,11 @@ def test_len(self):


def test_repr(self):
self.assertEquals(repr(self.STATUS),
"Choices("
"(0, 'DRAFT', 'is draft'), "
"(1, 'PUBLISHED', 'is published'), "
"(2, 'DELETED', 'is deleted'))")

self.assertEquals(repr(self.STATUS), "Choices" + repr((
(0, 'DRAFT', 'is draft'),
(1, 'PUBLISHED', 'is published'),
(2, 'DELETED', 'is deleted'),
)))


class InheritanceManagerTests(TestCase):
Expand Down

0 comments on commit 9c207e5

Please sign in to comment.