|
@@ -17,6 +17,11 @@ def theme(db):
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
+def other_theme(db):
|
|
|
+ return Theme.objects.create(name="Other theme")
|
|
|
+
|
|
|
+
|
|
|
+@pytest.fixture
|
|
|
def nonexisting_theme(mocker, default_theme):
|
|
|
return mocker.Mock(pk=default_theme.pk + 1)
|
|
|
|
|
@@ -33,13 +38,18 @@ def css(admin_client, theme):
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
+def css_link(admin_client, theme):
|
|
|
+ return theme.css.create(name="CSS link", url="https://somecdn/somefont.css")
|
|
|
+
|
|
|
+
|
|
|
+@pytest.fixture
|
|
|
def media(admin_client, theme):
|
|
|
url = reverse(
|
|
|
"misago:admin:appearance:themes:upload-media", kwargs={"pk": theme.pk}
|
|
|
)
|
|
|
with open(os.path.join(TESTS_DIR, "images", "test.svg")) as fp:
|
|
|
admin_client.post(url, {"assets": [fp]})
|
|
|
- return theme.media.last()
|
|
|
+ return theme.media.get(name="test.svg")
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
@@ -49,4 +59,4 @@ def image(admin_client, theme):
|
|
|
)
|
|
|
with open(os.path.join(TESTS_DIR, "images", "test.png"), "rb") as fp:
|
|
|
admin_client.post(url, {"assets": [fp]})
|
|
|
- return theme.media.last()
|
|
|
+ return theme.media.get(name="test.png")
|