Skip to content

Commit 27f009b

Browse files
committed
Updates tests for standalone
1 parent 1806574 commit 27f009b

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

tests/test_cli.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import pytest
55
from django.core.management import call_command
6+
from django.core.management import CommandError
67

78
from tailwind.utils import get_app_path
89

@@ -140,9 +141,9 @@ def test_tailwind_install_and_build_v4(no_package_lock, settings, app_name):
140141

141142
def test_tailwind_install_and_build_v4_standalone(settings, app_name):
142143
"""
143-
GIVEN a new Tailwind v3 app is initialized
144-
WHEN the install and build commands are run with optional package-lock settings
145-
THEN the app structure, dependencies, and CSS output should be created correctly
144+
GIVEN a new Tailwind v4s (standalone) app is initialized
145+
WHEN the install and build commands are run
146+
THEN the app structure should be created correctly
146147
"""
147148
call_command(
148149
"tailwind", "init", "--app-name", app_name, "--no-input", "--tailwind-version", "4s"
@@ -170,6 +171,28 @@ def test_tailwind_install_and_build_v4_standalone(settings, app_name):
170171
), "Tailwind has built a css/styles.css file"
171172

172173

174+
def test_tailwind_non_standalone_commands_v4_standalone(settings, app_name):
175+
"""
176+
GIVEN a new Tailwind v4 standalone app is initialized
177+
WHEN non-standalone-specific commands are run
178+
THEN they should raise CommandError indicating they are not supported
179+
"""
180+
call_command(
181+
"tailwind", "init", "--app-name", app_name, "--no-input", "--tailwind-version", "4s"
182+
)
183+
184+
settings.INSTALLED_APPS += [app_name]
185+
settings.TAILWIND_APP_NAME = app_name
186+
187+
call_command("tailwind", "install")
188+
189+
with pytest.raises(CommandError):
190+
call_command("tailwind", "update")
191+
192+
with pytest.raises(CommandError):
193+
call_command("tailwind", "plugin_install", "some-plugin")
194+
195+
173196
def test_tailwind_init_with_daisy_ui_v4(settings, app_name):
174197
"""
175198
GIVEN a new Tailwind v4 app is initialized with the --include-daisy-ui flag

0 commit comments

Comments
 (0)