[SQL-CVS] r1221 - SQLObject/trunk/sqlobject/tests
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-11-04 05:25:43
|
Author: ianb Date: 2005-11-04 05:25:25 +0000 (Fri, 04 Nov 2005) New Revision: 1221 Modified: SQLObject/trunk/sqlobject/tests/test_index_get.py Log: Make sure class name doesn't conflict with other tests Modified: SQLObject/trunk/sqlobject/tests/test_index_get.py =================================================================== --- SQLObject/trunk/sqlobject/tests/test_index_get.py 2005-11-04 05:19:49 UTC (rev 1220) +++ SQLObject/trunk/sqlobject/tests/test_index_get.py 2005-11-04 05:25:25 UTC (rev 1221) @@ -1,46 +1,46 @@ from sqlobject import * from sqlobject.tests.dbtest import * -class Person(SQLObject): +class PersonIndexGet(SQLObject): firstName = StringCol() lastName = StringCol() age = IntCol(alternateID=True) nameIndex = DatabaseIndex(firstName, lastName, unique=True) def test_1(): - setupClass(Person) + setupClass(PersonIndexGet) - Person(firstName='Eric', lastName='Idle', age=62) - Person(firstName='Terry', lastName='Gilliam', age=65) - Person(firstName='John', lastName='Cleese', age=66) + PersonIndexGet(firstName='Eric', lastName='Idle', age=62) + PersonIndexGet(firstName='Terry', lastName='Gilliam', age=65) + PersonIndexGet(firstName='John', lastName='Cleese', age=66) - Person.get(1) - Person.nameIndex.get('Terry', 'Gilliam') - Person.nameIndex.get(firstName='John', lastName='Cleese') + PersonIndexGet.get(1) + PersonIndexGet.nameIndex.get('Terry', 'Gilliam') + PersonIndexGet.nameIndex.get(firstName='John', lastName='Cleese') try: - print Person.nameIndex.get(firstName='Graham', lastName='Chapman') + print PersonIndexGet.nameIndex.get(firstName='Graham', lastName='Chapman') except Exception, e: pass else: raise AssertError try: - print Person.nameIndex.get('Terry', lastName='Gilliam') + print PersonIndexGet.nameIndex.get('Terry', lastName='Gilliam') except Exception, e: pass else: raise AssertError try: - print Person.nameIndex.get('Terry', 'Gilliam', 65) + print PersonIndexGet.nameIndex.get('Terry', 'Gilliam', 65) except Exception, e: pass else: raise AssertError try: - print Person.nameIndex.get('Terry') + print PersonIndexGet.nameIndex.get('Terry') except Exception, e: pass else: |