Beispiel #1
0
 def test_quest_detail(self):
     """A owner should be able to see his quest detail-view and a hero applying for that quest."""
     quest = create_quest(title='questwithadventure', owner=self.user)
     adventure = create_adventure(quest)
     response = self.client.get(reverse("quest_detail", args=(quest.pk, )))
     self.assertContains(response, quest.title)
     self.assertContains(response, adventure.user.username)
Beispiel #2
0
 def test_suggested_quests(self):
     """A user should be presented with quest suggestions."""
     master = create_user()
     quest = create_quest(owner=master, title='suggested_quest_0')
     response = self.client.get(reverse('home'))
     self.assertContains(response, quest.title)
Beispiel #3
0
 def test_quest_details_as_owner(self):
     """An owner can see quest-details."""
     quest = create_quest(owner=self.user)
     response = self.client.get(reverse('quest_detail', args=(quest.pk,)))
     self.assertContains(response, quest.title)
Beispiel #4
0
 def test_quest_details_as_hero(self):
     """A hero can see quest-details."""
     quest = create_quest()
     response = self.client.get(reverse('quest_detail', args=(quest.pk,)))
     self.assertContains(response, quest.title)
Beispiel #5
0
 def test_quest_list(self):
     """A user should be able to visit the quest-list-view."""
     quest = create_quest(title='aquest')
     response = self.client.get(reverse('quest_list'))
     self.assertContains(response, 'aquest')