Author: ianb
Date: 2005-02-16 03:06:30 +0000 (Wed, 16 Feb 2005)
New Revision: 604
Modified:
trunk/SQLObject/sqlobject/inheritance/tests/test_inheritance.py
Log:
Renamed Person class to InherPerson, so its name doesn't conflict with
the name of the table in test_auto
Modified: trunk/SQLObject/sqlobject/inheritance/tests/test_inheritance.py
===================================================================
--- trunk/SQLObject/sqlobject/inheritance/tests/test_inheritance.py 2005-02-14 02:31:35 UTC (rev 603)
+++ trunk/SQLObject/sqlobject/inheritance/tests/test_inheritance.py 2005-02-16 03:06:30 UTC (rev 604)
@@ -7,29 +7,29 @@
########################################
-class Person(InheritableSQLObject):
+class InherPerson(InheritableSQLObject):
_inheritable = 1 # I want this class to be inherited
firstName = StringCol()
lastName = StringCol()
-class Employee(Person):
+class Employee(InherPerson):
_inheritable = 0 # If I don't want this class to be inherited
position = StringCol()
def setup():
- setupClass(Person)
+ setupClass(InherPerson)
setupClass(Employee)
Employee(firstName='Ian', lastName='Bicking', position='Project leader')
- Person(firstName='Daniel', lastName='Savard')
+ InherPerson(firstName='Daniel', lastName='Savard')
def test_inheritance():
setup()
- persons = Person.select() # all
+ persons = InherPerson.select() # all
for person in persons:
- assert isinstance(person, Person)
+ assert isinstance(person, InherPerson)
if isinstance(person, Employee):
assert not hasattr(person, "childName")
else:
@@ -40,7 +40,7 @@
def test_inheritance_select():
setup()
- persons = Person.select(Person.q.firstName <> None)
+ persons = InherPerson.select(InherPerson.q.firstName <> None)
assert persons.count() == 2
employees = Employee.select(Employee.q.firstName <> None)
|