[CalendarServer-changes] [7155] CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test /test_sqlsyntax.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 7 19:08:14 PST 2011
Revision: 7155
http://trac.macosforge.org/projects/calendarserver/changeset/7155
Author: glyph at apple.com
Date: 2011-03-07 19:08:14 -0800 (Mon, 07 Mar 2011)
Log Message:
-----------
fix tests for FunctionInvocation now that its signature has changed (it shouldn't be called directly, you should create a Function first and then call that to produce one)
Modified Paths:
--------------
CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py
Modified: CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py
===================================================================
--- CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py 2011-03-08 03:08:02 UTC (rev 7154)
+++ CalendarServer/branches/users/glyph/oracle/twext/enterprise/dal/test/test_sqlsyntax.py 2011-03-08 03:08:14 UTC (rev 7155)
@@ -26,7 +26,7 @@
TableMismatch, Parameter, Max, Len, NotEnoughValues
, Savepoint, RollbackToSavepoint, ReleaseSavepoint, SavepointAction)
-from twext.enterprise.dal.syntax import FunctionInvocation
+from twext.enterprise.dal.syntax import Function
from twext.enterprise.dal.syntax import FixedPlaceholder, NumericPlaceholder
from twext.enterprise.ienterprise import POSTGRES_DIALECT, ORACLE_DIALECT
@@ -614,10 +614,11 @@
L{Update} values may be L{FunctionInvocation}s, to update to computed
values in the database.
"""
+ sqlfunc = Function("hello")
self.assertEquals(
Update(
{self.schema.FOO.BAR: 23,
- self.schema.FOO.BAZ: FunctionInvocation("hello")},
+ self.schema.FOO.BAZ: sqlfunc()},
Where=self.schema.FOO.BAZ == 9
).toSQL(),
SQLFragment("update FOO set BAR = ?, BAZ = hello() "
@@ -630,10 +631,11 @@
L{Update} values may be L{FunctionInvocation}s, to update to computed
values in the database.
"""
+ sqlfunc = Function("hello")
self.assertEquals(
Insert(
{self.schema.FOO.BAR: 23,
- self.schema.FOO.BAZ: FunctionInvocation("hello")},
+ self.schema.FOO.BAZ: sqlfunc()},
).toSQL(),
SQLFragment("insert into FOO (BAR, BAZ) "
"values (?, hello())", [23])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110307/52b1ac26/attachment.html>
More information about the calendarserver-changes
mailing list