Пример #1
0
    def test_get_lookup(self):
        class Meta:
            model = Article
            fields = (
                ('author__team__name', {'lookup': 'contain'}),
                'title',
            )

        options = SearchFormOptions(Meta)
        assert options.get_lookup('author__team__name') == 'contain'
        assert options.get_lookup('title') == ''
Пример #2
0
    def test_get_lookup(self):
        class Meta:
            model = Article
            fields = (
                ('author__team__name', {
                    'lookup': 'contain'
                }),
                'title',
            )

        options = SearchFormOptions(Meta)
        assert options.get_lookup('author__team__name') == 'contain'
        assert options.get_lookup('title') == ''