Skip to content

Instantly share code, notes, and snippets.

Oleg Olegblow

Block or report user

Report or block Olegblow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9d2da2a26ac7136358c7717315a498af
Form:
class BaseFilter(django_filters.FilterSet):
"""Базовый класс фильтров ."""
def __init__(self, *args, **kwargs):
prefix_slug = kwargs.pop('prefix_slug', None)
super().__init__(*args, **kwargs)
if prefix_slug is not None:
self.set_filter_choices(prefix_slug)
View gist:535d5bfd46810abaa9d949cb0213297b
@pytest.mark.django_db
def test_call_create_object():
"""Тест celery задачи."""
task = call_create_object.delay()
task.get()
assert task.state == "SUCCESS"
@pytest.fixture(scope='module')
def factory():
return RequestFactory()
You can’t perform that action at this time.