コード例 #1
0
 def test_init__no_args(self):
     from ebpub.db.schemafilters import AttributeFilter
     schemafield = self._mock_schemafield(name='mock-sf')
     qs = {}
     request = context = None
     filter = AttributeFilter(request, context, qs, schemafield=schemafield)
     self.assertEqual(filter.get_query_params(), {'by-mock-sf': ''})
コード例 #2
0
 def test_init__no_args(self):
     from ebpub.db.schemafilters import AttributeFilter
     schemafield = self._mock_schemafield(name='mock-sf')
     qs = {}
     request = context = None
     filter = AttributeFilter(request, context, qs, schemafield=schemafield)
     self.assertEqual(filter.get_query_params(),
                      {'by-mock-sf': ''})
コード例 #3
0
 def test_init__with_time(self):
     from ebpub.db.schemafilters import AttributeFilter
     schemafield = self._mock_schemafield(name='mock-sf')
     when = datetime.time(22, 40)
     qs = {}
     request = context = None
     filter = AttributeFilter(request, context, qs, when, schemafield=schemafield)
     self.assertEqual(filter.get_query_params(), 
                      {'by-mock-sf': '22:40:00'})
コード例 #4
0
    def test_init__with_datetime(self):
        from ebpub.db.schemafilters import AttributeFilter

        schemafield = self._mock_schemafield(name="mock-sf")
        when = datetime.datetime(2009, 1, 23, 22, 40)
        qs = {}
        request = context = None
        filter = AttributeFilter(request, context, qs, when, schemafield=schemafield)
        self.assertEqual(filter.get_query_params(), {"by-mock-sf": "2009-01-23T22:40:00"})
コード例 #5
0
 def test_init__with_time(self):
     from ebpub.db.schemafilters import AttributeFilter
     schemafield = self._mock_schemafield(name='mock-sf')
     when = datetime.time(22, 40)
     qs = {}
     request = context = None
     filter = AttributeFilter(request,
                              context,
                              qs,
                              when,
                              schemafield=schemafield)
     self.assertEqual(filter.get_query_params(), {'by-mock-sf': '22:40:00'})