fixed failing test to assert the right thing to match new Palette applet code
All checks were successful
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-04-18 02:34:39 -04:00
parent 122de3bc80
commit f15b17f7bd

View File

@@ -317,12 +317,12 @@ class SetPaletteTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json(), {"palette": "palette-default"})
def test_dashboard_contains_set_palette_form(self):
def test_unlocked_swatches_count_matches_context(self):
response = self.client.get(self.url)
parsed = lxml.html.fromstring(response.content)
forms = parsed.cssselect('form[action="/dashboard/set_palette"]')
swatches = parsed.cssselect(".swatch:not(.locked)")
unlocked = [p for p in response.context["palettes"] if not p["locked"]]
self.assertEqual(len(forms), len(unlocked))
self.assertEqual(len(swatches), len(unlocked))
def test_active_palette_swatch_has_active_class(self):
response = self.client.get(self.url)