diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-12 21:08:31 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-08-12 21:08:31 +0000 |
| commit | 605ed429cd7992e3080f8293ce62c98c9c766475 (patch) | |
| tree | b23baa367f2297e36bd7f19fa6d0ee259ea35745 /test | |
| parent | 98933ba84d6618d5fba366e556932223964c7200 (diff) | |
| download | sqlalchemy-605ed429cd7992e3080f8293ce62c98c9c766475.tar.gz | |
improved error message when a backref conflicts with a column-based property
Diffstat (limited to 'test')
| -rw-r--r-- | test/orm/mapper.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/orm/mapper.py b/test/orm/mapper.py index 5cf665fd4..49b5a0cbc 100644 --- a/test/orm/mapper.py +++ b/test/orm/mapper.py @@ -101,6 +101,21 @@ class MapperTest(MapperSuperTest): finally: table.drop() + def testpropconflict(self): + """test that a backref created against an existing mapper with a property name + conflict raises a decent error message""" + mapper(Address, addresses) + mapper(User, users, + properties={ + 'addresses':relation(Address, backref='email_address') + }) + try: + class_mapper(Address) + class_mapper(User) + assert False + except exceptions.ArgumentError: + pass + def testrefresh(self): mapper(User, users, properties={'addresses':relation(mapper(Address, addresses))}) s = create_session() |
