File: test_naturally_equivalent.py

package info (click to toggle)
python-sqlalchemy-utils 0.30.12-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,056 kB
  • sloc: python: 10,350; makefile: 160
file content (14 lines) | stat: -rw-r--r-- 465 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from sqlalchemy_utils.functions import naturally_equivalent
from tests import TestCase


class TestNaturallyEquivalent(TestCase):
    def test_returns_true_when_properties_match(self):
        assert naturally_equivalent(
            self.User(name=u'someone'), self.User(name=u'someone')
        )

    def test_skips_primary_keys(self):
        assert naturally_equivalent(
            self.User(id=1, name=u'someone'), self.User(id=2, name=u'someone')
        )