server/test/unittest_rql2sql.py
branchstable
changeset 9678 c34f0cee89b7
parent 9324 a5ce068143ad
child 9769 d3f8866a48f5
equal deleted inserted replaced
9566:cc7e0f4eb10f 9678:c34f0cee89b7
  1950 
  1950 
  1951     def test_today(self):
  1951     def test_today(self):
  1952         for t in self._parse([("Any X WHERE X creation_date TODAY, X is Affaire",
  1952         for t in self._parse([("Any X WHERE X creation_date TODAY, X is Affaire",
  1953                         '''SELECT _X.cw_eid
  1953                         '''SELECT _X.cw_eid
  1954 FROM cw_Affaire AS _X
  1954 FROM cw_Affaire AS _X
  1955 WHERE DATE(_X.cw_creation_date)=CURRENT_DATE'''),
  1955 WHERE DATE(_X.cw_creation_date)=%s''' % self.dbhelper.sql_current_date()),
  1956 
  1956 
  1957                        ("Personne P where not P datenaiss TODAY",
  1957                        ("Personne P where not P datenaiss TODAY",
  1958                         '''SELECT _P.cw_eid
  1958                         '''SELECT _P.cw_eid
  1959 FROM cw_Personne AS _P
  1959 FROM cw_Personne AS _P
  1960 WHERE NOT (DATE(_P.cw_datenaiss)=CURRENT_DATE)'''),
  1960 WHERE NOT (DATE(_P.cw_datenaiss)=%s)''' % self.dbhelper.sql_current_date()),
  1961                        ]):
  1961                        ]):
  1962             yield t
  1962             yield t
  1963 
  1963 
  1964 
  1964 
  1965 class SqliteSQLGeneratorTC(PostgresSQLGeneratorTC):
  1965 class SqliteSQLGeneratorTC(PostgresSQLGeneratorTC):