File: test_naturally_equivalent.py

package info (click to toggle)
python-sqlalchemy-utils 0.41.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,252 kB
  • sloc: python: 13,566; makefile: 141
file content (13 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
from sqlalchemy_utils.functions import naturally_equivalent


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

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