generated from westfarn/web_django_template
Ship College Craft public site and point CI deploys at college_craft.
Replaces template branding with College Craft pages, assets, and copy, and matches Gitea deploy workflows to the server-infra catalog name and master branch so beta deploys actually run. Closes #1
This commit is contained in:
+54
-3
@@ -26,10 +26,61 @@ class UnderConstructionTests(TestCase):
|
||||
|
||||
|
||||
class PublicSmokeTests(TestCase):
|
||||
def test_about_and_contact_get(self):
|
||||
def test_public_pages_get(self):
|
||||
client = Client()
|
||||
self.assertEqual(client.get(reverse("public:about")).status_code, 200)
|
||||
self.assertEqual(client.get(reverse("public:contact")).status_code, 200)
|
||||
for name in (
|
||||
"public:home",
|
||||
"public:about",
|
||||
"public:services",
|
||||
"public:testimonials",
|
||||
"public:contact",
|
||||
"public:careers",
|
||||
"public:terms",
|
||||
):
|
||||
self.assertEqual(client.get(reverse(name)).status_code, 200, name)
|
||||
|
||||
def test_contact_form_creates_lead(self):
|
||||
client = Client()
|
||||
response = client.post(
|
||||
reverse("public:contact"),
|
||||
{
|
||||
"first_name": "Pat",
|
||||
"last_name": "Jones",
|
||||
"email": "pat@example.com",
|
||||
"phone": "6305550100",
|
||||
"interest": "interior",
|
||||
"message": "Kitchen walls",
|
||||
},
|
||||
)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
from leads.models import Lead
|
||||
|
||||
lead = Lead.objects.get()
|
||||
self.assertIn("Interior painting", lead.message)
|
||||
|
||||
def test_careers_form_creates_lead(self):
|
||||
client = Client()
|
||||
response = client.post(
|
||||
reverse("public:careers"),
|
||||
{
|
||||
"first_name": "Sam",
|
||||
"last_name": "Lee",
|
||||
"email": "sam@example.com",
|
||||
"phone": "6305550199",
|
||||
"positions": ["painter"],
|
||||
"qualifications": "Five summers of exterior work.",
|
||||
"start_date": "June",
|
||||
"drivers_license": "yes",
|
||||
"has_vehicle": "yes",
|
||||
},
|
||||
)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
from contacts.models import Contact
|
||||
from leads.models import Lead
|
||||
|
||||
lead = Lead.objects.get()
|
||||
self.assertEqual(lead.contact.source, Contact.Source.CAREERS)
|
||||
self.assertIn("Employment application", lead.message)
|
||||
|
||||
|
||||
class DispatchDueTests(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user