def testAward(self): api.award(self.user, "test", "reason") award = Award.objects.get(badge=self.badge, user=self.user) self.assertEqual(award.reason, "reason") self.assertEqual(award.badge, self.badge) self.assertTrue(api.user_has_badge(self.user, "test"))
def testUserHasBadge(self): badge = api.create_badge("test_badge", "Test Badge", "test desc") api.award(self.user, "test_badge") self.assertTrue(api.user_has_badge(self.user, "test_badge"))