示例#1
0
文件: tests.py 项目: caminus/caminus
 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"))
示例#2
0
文件: tests.py 项目: caminus/caminus
 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"))