Ejemplo n.º 1
0
    def test_mintimeuuid_function(self):
        """
        Tests that queries with helper functions are generated properly
        """
        now = datetime.now()
        where = WhereClause('time', EqualsOperator(), functions.MinTimeUUID(now))
        where.set_context_id(5)

        self.assertEqual(str(where), '"time" = MinTimeUUID(%(5)s)')
        ctx = {}
        where.update_context(ctx)
        self.assertEqual(ctx, {'5': DateTime().to_database(now)})
Ejemplo n.º 2
0
    class DatetimeTest(Model):

        test_id = Integer(primary_key=True)
        created_at = DateTime()
Ejemplo n.º 3
0
 class DatetimeTest(Model):
     __keyspace__ = 'test'
     test_id = Integer(primary_key=True)
     created_at = DateTime()