FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merged revision 3789 from the branch 0.9: minor refactoring. · sqlobject/sqlobject@f717937 · GitHub

Commit f717937

Browse files
committed
Merged revision 3789 from the branch 0.9: minor refactoring.
git-svn-id: http://svn.colorstudy.com/SQLObject/trunk@3791 95a46c32-92d2-0310-94a5-8d71aeb3d4b3
1 parent bbd9b63 commit f717937

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

‎sqlobject/tests/test_events.py‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,24 @@ class NewEventTester(EventTester):
7575
assert watcher.log[1] == expect
7676

7777

78-
class A(InheritableSQLObject):
78+
class InheritableEventTestA(InheritableSQLObject):
7979
a = IntCol()
8080

81-
class B(A):
81+
class InheritableEventTestB(InheritableEventTestA):
8282
b = IntCol()
8383

84-
class C(B):
84+
class InheritableEventTestC(InheritableEventTestB):
8585
c = IntCol()
8686

87+
def _query(instance):
88+
InheritableEventTestA.get(instance.id)
8789

88-
def test_inheritance_row_created():
89-
setupClass(A)
90-
setupClass(B)
91-
setupClass(C)
92-
93-
def test_query(instance):
94-
id = instance.id
95-
A.get(id)
90+
def _signal(kwargs, postfuncs):
91+
postfuncs.append(_query)
9692

97-
def signal(kwargs, postfuncs):
98-
postfuncs.append(test_query)
93+
def test_inheritance_row_created():
94+
setupClass([InheritableEventTestA, InheritableEventTestB, InheritableEventTestC])
9995

100-
events.listen(signal, A, events.RowCreatedSignal)
96+
events.listen(_signal, InheritableEventTestA, events.RowCreatedSignal)
10197

102-
C(a=1, b=2, c=3)
98+
InheritableEventTestC(a=1, b=2, c=3)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL