Fix broken tests.

This commit is contained in:
Bradley Ayers 2015-04-20 03:51:26 +10:00
parent 8d7626855e
commit 5732cefcf3
4 changed files with 11 additions and 8 deletions

View File

@ -1,13 +1,16 @@
# coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models.fields import FieldDoesNotExist
from django_tables2.templatetags.django_tables2 import title
from django_tables2.utils import A, AttributeDict, OrderBy, OrderByTuple
from collections import OrderedDict
from itertools import islice
import six
import warnings
from django.db.models.fields import FieldDoesNotExist
import six
from django_tables2.templatetags.django_tables2 import title
from django_tables2.utils import A, AttributeDict, OrderBy, OrderByTuple
from ..utils import python_2_unicode_compatible
class Library(object):
"""
@ -249,6 +252,7 @@ class Column(object): # pylint: disable=R0902
return cls(verbose_name=verbose_name)
@python_2_unicode_compatible
class BoundColumn(object):
"""
A *run-time* version of `.Column`. The difference between
@ -278,7 +282,7 @@ class BoundColumn(object):
self.column = column
self.name = name
def __unicode__(self):
def __str__(self):
return six.text_type(self.header)
@property

View File

@ -151,7 +151,7 @@ class OrderByTuple(tuple):
transformed.append(item)
return super(OrderByTuple, cls).__new__(cls, transformed)
def __unicode__(self):
def __str__(self):
return ','.join(self)
def __contains__(self, name):

View File

@ -261,7 +261,7 @@ def test_as_html_db_queries(transactional_db):
# with queries(count=1):
# PersonTable(Person.objects.all()).as_html()
@pytest.mark.django_db
class TestQueries(TransactionTestCase):
def test_as_html_db_queries(self):
class PersonTable(tables.Table):

View File

@ -91,5 +91,4 @@ deps = -r{toxinidir}/requirements/django-1.3.x.pip
[testenv:py27-dj12]
basepython = python2.7
commands = python -W error {envbindir}/coverage run setup.py test []
deps = -r{toxinidir}/requirements/django-1.2.x.pip