fixed applet seeding in 0005 migration; many FTs & ITs now require authentication before they pass; New List & My Lists converted to dash applets; home.html offloaded and _applets.html onboarded w. these applets
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -14,6 +14,11 @@ from apps.lyric.models import User
|
||||
|
||||
|
||||
class HomePageTest(TestCase):
|
||||
def setUp(self):
|
||||
self.user = User.objects.create(email="disco@test.io")
|
||||
self.client.force_login(self.user)
|
||||
Applet.objects.get_or_create(slug="new-list", defaults={"name": "New List"})
|
||||
|
||||
def test_uses_home_template(self):
|
||||
response = self.client.get('/')
|
||||
self.assertTemplateUsed(response, 'apps/dashboard/home.html')
|
||||
@@ -28,8 +33,12 @@ class HomePageTest(TestCase):
|
||||
self.assertIn("text", [input.get("name") for input in inputs])
|
||||
|
||||
class NewListTest(TestCase):
|
||||
def setUp(self):
|
||||
user = User.objects.create(email="disco@test.io")
|
||||
self.client.force_login(user)
|
||||
|
||||
def test_can_save_a_POST_request(self):
|
||||
self. client.post("/dashboard/new_list", data={"text": "A new list item"})
|
||||
self.client.post("/dashboard/new_list", data={"text": "A new list item"})
|
||||
self.assertEqual(Item.objects.count(), 1)
|
||||
new_item = Item.objects.get()
|
||||
self.assertEqual(new_item.text, "A new list item")
|
||||
|
||||
Reference in New Issue
Block a user