conftest.py 336 B

123456789101112131415161718
  1. import pytest
  2. from ....themes.models import Theme
  3. @pytest.fixture
  4. def default_theme(db):
  5. return Theme.objects.get(is_default=True)
  6. @pytest.fixture
  7. def theme(db):
  8. return Theme.objects.create(name="Custom theme")
  9. @pytest.fixture
  10. def nonexisting_theme(mocker, default_theme):
  11. return mocker.Mock(pk=default_theme.pk + 1)