
Also: Allow override of database name and user in tests (important for me as I would have to mess with my PSQL and MySQL database users otherwise) Use dict.items instead of six.iteritems as it sporadically caused RuntimeError: dictionary changed size during iteration in Python 2.6 tests. Fix typo DNS to DSN Adds Python 3.5 to tox.ini Added an .editorconfig Import babel.dates in sqlalchemy_utils.i18n as an exception would be raised when using the latest versions of babel.
14 lines
428 B
Python
14 lines
428 B
Python
from sqlalchemy_utils.functions import naturally_equivalent
|
|
|
|
|
|
class TestNaturallyEquivalent(object):
|
|
def test_returns_true_when_properties_match(self, User):
|
|
assert naturally_equivalent(
|
|
User(name=u'someone'), User(name=u'someone')
|
|
)
|
|
|
|
def test_skips_primary_keys(self, User):
|
|
assert naturally_equivalent(
|
|
User(id=1, name=u'someone'), User(id=2, name=u'someone')
|
|
)
|