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"))
def testSingleSignal(self): api.create_badge("test_badge", "Test Badge", "Test Desc") api.badge_awarded.connect(self._gotAward, sender="test_badge") api.award(self.user, "test_badge", "reason") self.assertTrue(self.awarded)
def testCreateBadge(self): badge = api.create_badge("test_badge", "Test Badge", "Test Description") self.assertEqual(badge, api.find_badge("test_badge"))