def test_select_default(self): Currency.objects.create(code='EUR', name="Euro") usd = Currency.objects.create(code='USD', name="Dollar", is_default=True) default = default_currency() self.assertEqual(default, usd)
def test_select_eur(self): eur = Currency.objects.create(code='EUR', name="Euro") Currency.objects.create(code='USD', name="Dollar") default = default_currency() self.assertEqual(default, eur)
def test_non_existent(self): default = default_currency() self.assertEqual(default, None)