40 lines
1.5 KiB
Python
40 lines
1.5 KiB
Python
|
|
from django.test import SimpleTestCase
|
||
|
|
|
||
|
|
from apps.drama.models import Note
|
||
|
|
|
||
|
|
|
||
|
|
def _note(slug):
|
||
|
|
n = Note()
|
||
|
|
n.slug = slug
|
||
|
|
return n
|
||
|
|
|
||
|
|
|
||
|
|
class NoteDisplayBaltimoreanTest(SimpleTestCase):
|
||
|
|
"""`_NOTE_DISPLAY['baltimorean']` — greeting/title combo "Ayo, Ard!" replaces
|
||
|
|
"Welcome, Earthman" once the user dons the Baltimorean Note (unlocked by
|
||
|
|
first-time `pronouns = bawlmorese` selection)."""
|
||
|
|
|
||
|
|
def test_baltimorean_display_title_is_ard(self):
|
||
|
|
self.assertEqual(_note("baltimorean").display_title, "Ard!")
|
||
|
|
|
||
|
|
def test_baltimorean_display_greeting_is_ayo(self):
|
||
|
|
self.assertEqual(_note("baltimorean").display_greeting, "Ayo,")
|
||
|
|
|
||
|
|
def test_baltimorean_display_name_is_baltimorean(self):
|
||
|
|
"""The my-notes heading label — `.title()` of the slug recovers the
|
||
|
|
proper rendering for any slug without a `name` override in
|
||
|
|
`_NOTE_DISPLAY`. Baltimorean has no override, so this should fall
|
||
|
|
through to `slug.title()` → 'Baltimorean'."""
|
||
|
|
self.assertEqual(_note("baltimorean").display_name, "Baltimorean")
|
||
|
|
|
||
|
|
|
||
|
|
class NoteDisplayStargazerTest(SimpleTestCase):
|
||
|
|
"""Smoke tests for the existing stargazer entry — pins the contract that
|
||
|
|
new entries follow."""
|
||
|
|
|
||
|
|
def test_stargazer_display_title_is_stargazer(self):
|
||
|
|
self.assertEqual(_note("stargazer").display_title, "Stargazer")
|
||
|
|
|
||
|
|
def test_stargazer_display_greeting_is_welcome(self):
|
||
|
|
self.assertEqual(_note("stargazer").display_greeting, "Welcome,")
|