~j5-dev/+junk/sqlalchemy-0.6.1

« back to all changes in this revision

Viewing changes to test/orm/mapper.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2009-05-27 19:31:25 UTC
  • mfrom: (1.1.19 upstream) (6.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090527193125-el85evabz23xjhud
Tags: 0.5.4p2-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1751
1751
                return [self.x, self.y]
1752
1752
            __hash__ = None
1753
1753
            def __eq__(self, other):
1754
 
                return other.x == self.x and other.y == self.y
 
1754
                return isinstance(other, Point) and other.x == self.x and other.y == self.y
1755
1755
            def __ne__(self, other):
1756
 
                return not self.__eq__(other)
 
1756
                return not isinstance(other, Point) or not self.__eq__(other)
1757
1757
 
1758
1758
        class Graph(object):
1759
1759
            pass
1819
1819
        # query by columns
1820
1820
        eq_(sess.query(Edge.start, Edge.end).all(), [(3, 4, 5, 6), (14, 5, 19, 5)])
1821
1821
 
 
1822
        e = g.edges[1]
 
1823
        e.end.x = e.end.y = None
 
1824
        sess.flush()
 
1825
        eq_(sess.query(Edge.start, Edge.end).all(), [(3, 4, 5, 6), (14, 5, None, None)])
 
1826
 
 
1827
 
1822
1828
    @testing.resolve_artifact_names
1823
1829
    def test_pk(self):
1824
1830
        """Using a composite type as a primary key"""