示例#1
0
def test_Contributors(request_factory):
    from clld.web.datatables.contributor import Contributors

    with request_factory(params={
            'iSortingCols': '1',
            'iSortCol_0': '0',
            'sSortDir_0': 'desc'
    }) as req:
        handle_dt(req, Contributors, common.Contributor)
def test_Contributors(request_factory):
    from clld.web.datatables.contributor import Contributors

    with request_factory(params={
        'iSortingCols': '1',
        'iSortCol_0': '0',
        'sSortDir_0': 'desc'}
    ) as req:
        handle_dt(req, Contributors, common.Contributor)
示例#3
0
def test_DataTable3(env, request_factory):
    class TestTable(DataTable):
        def col_defs(self):
            return [PercentCol(self, 'frequency'), Col(self, 'name', choices=['a'])]

    handle_dt(env['request'], TestTable, common.Value)

    with request_factory(params={'sSearch_0': '> 10', 'sSearch_1': 'a'}) as req:
        handle_dt(req, TestTable, common.Value)
示例#4
0
def test_DataTable2(request_factory):
    class TestCol(Col):
        def search(self, qs):
            return filter_number(cast(self.dt.model.pk, Integer), qs, type_=int)

    class TestTable(DataTable):
        def col_defs(self):
            return [Col(self, 'latitude'), TestCol(self, 'pk')]

    with request_factory(params={'sSearch_0': '> 1', 'sSearch_1': '> 1'}) as req:
        handle_dt(req, TestTable, common.Language)
示例#5
0
def test_DataTable3(env, request_factory):
    class TestTable(DataTable):
        def col_defs(self):
            return [
                PercentCol(self, 'frequency'),
                Col(self, 'name', choices=['a'])
            ]

    handle_dt(env['request'], TestTable, common.Value)

    with request_factory(params={
            'sSearch_0': '> 10',
            'sSearch_1': 'a'
    }) as req:
        handle_dt(req, TestTable, common.Value)
示例#6
0
def test_DataTable2(request_factory):
    class TestCol(Col):
        def search(self, qs):
            return filter_number(cast(self.dt.model.pk, Integer),
                                 qs,
                                 type_=int)

    class TestTable(DataTable):
        def col_defs(self):
            return [Col(self, 'latitude'), TestCol(self, 'pk')]

    with request_factory(params={
            'sSearch_0': '> 1',
            'sSearch_1': '> 1'
    }) as req:
        handle_dt(req, TestTable, common.Language)
def test_Contributions(env):
    from clld.web.datatables.contribution import Contributions

    handle_dt(env['request'], Contributions, common.Contribution)
def test_table(env):
    handle_dt(env['request'], Unitparameters, common.UnitParameter)
示例#9
0
def test_Values(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Values, common.Value)
def test_Units(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Units, common.Unit)
def test_Languages(env):
    from clld.web.datatables.language import Languages

    handle_dt(env['request'], Languages, common.Language)
示例#12
0
def test_Parameters(env):
    from clld.web.datatables.parameter import Parameters

    handle_dt(env['request'], Parameters, common.Parameter)
示例#13
0
def test_Sources(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Sources, common.Source)
示例#14
0
def test_plain(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Sentences, common.Sentence)
示例#15
0
def test_Unitvalues(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Unitvalues, common.UnitValue)
def test_Contributions(env):
    from clld.web.datatables.contribution import Contributions

    handle_dt(env['request'], Contributions, common.Contribution)
示例#17
0
def test_DataTable_cols(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Table, common.Contributor)
示例#18
0
def test_plain(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Sentences, common.Sentence)
示例#19
0
def test_Values(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Valuesets, common.ValueSet)
示例#20
0
def test_DataTable_cols(request_factory, params):
    with request_factory(params=params) as req:
        handle_dt(req, Table, common.Contributor)