new apps/dashboard/wallet.html for stripe payment integration and user's consumables; nav added to _footer.html & also dynamic copyright year with django now Y template; new apps.dash.tests ITs & UTs reflect new wallet functionality in .urls & .views

This commit is contained in:
Disco DeDisco
2026-03-08 15:14:41 -04:00
parent 571f659b19
commit 076d75effe
17 changed files with 362 additions and 42 deletions

View File

@@ -0,0 +1,43 @@
from django.test import SimpleTestCase
from unittest.mock import MagicMock
from apps.lyric.models import Token
class CoinTooltipTest(SimpleTestCase):
def setUp(self):
self.coin = Token ()
self.coin.token_type = Token.COIN
self.coin.expires_at = None
def test_tooltip_contains_name(self):
self.assertIn("Coin-on-a-String", self.coin.tooltip_text())
def test_tooltip_contains_entry(self):
self.assertIn("Admit 1 Entry", self.coin.tooltip_text())
def test_tooltip_contains_reuse_description(self):
self.assertIn("and another after that", self.coin.tooltip_text())
def test_tooltip_contains_no_expiry(self):
self.assertIn("no expiry", self.coin.tooltip_text())
class FreeTokenTooltipTest(SimpleTestCase):
def setUp(self):
self.token = Token()
self.token.token_type = Token.FREE
self.token.expires_at = MagicMock()
self.token.expires_at.strftime = lambda fmt: "2026-03-15"
def test_tooltip_contains_name(self):
self.assertIn("Free Token", self.token.tooltip_text())
def test_tooltip_contains_entry(self):
self.assertIn("Admit 1 Entry", self.token.tooltip_text())
def test_tooltip_contains_expires(self):
self.assertIn("Expires", self.token.tooltip_text())
def test_tooltip_contains_expiry_date(self):
self.assertIn("2026-03-15", self.token.tooltip_text())