Exemplo n.º 1
0
Arquivo: tests.py Projeto: slok/dwarf
    def test_achievement_saver(self):
        user = User.objects.get(id=1)
        achievement = Achievement.objects.get(id=1)

        self.assertFalse(receivers.has_achievement(user, achievement))

        receivers.save_achievement(user, achievement)

        self.assertTrue(receivers.has_achievement(user, achievement))
Exemplo n.º 2
0
Arquivo: tests.py Projeto: slok/dwarf
    def test_achievement_already_exists(self):
        user = User.objects.get(id=1)
        achievement = Achievement.objects.get(id=1)

        self.assertFalse(receivers.has_achievement(user, achievement))

        UserAchievement(user=user, achievement=achievement).save()

        self.assertTrue(receivers.has_achievement(user, achievement))