Пример #1
0
 def test_tutorial_detail_superuser(self):
     user = create_user('bob', use_hash=False, with_profile=True)
     user.is_superuser = True
     user.is_staff = True
     user.save()
     tutorial = create_tutorial(status=Tutorial.HIDDEN)
     self.client.login(username='******', password='******')
     response = self.client.get(tutorial.get_absolute_url())
     eq_(response.status_code, 200)
     eq_(response.context['tutorial'], tutorial)
     self.client.logout()
 def test_tutorial_detail_superuser(self):
     user = create_user('bob', use_hash=False, with_profile=True)
     user.is_superuser = True
     user.is_staff = True
     user.save()
     tutorial = create_tutorial(status=Tutorial.HIDDEN)
     self.client.login(username='******', password='******')
     response = self.client.get(tutorial.get_absolute_url())
     eq_(response.status_code, 200)
     eq_(response.context['tutorial'], tutorial)
     self.client.logout()
 def test_tutorial_list(self):
     tutorial = create_tutorial(status=Tutorial.LIVE)
     response = self.client.get(self.url)
     eq_(response.status_code, 200)
 def test_tutorial_detail_hidden(self):
     tutorial = create_tutorial(status=Tutorial.HIDDEN)
     response = self.client.get(tutorial.get_absolute_url())
     eq_(response.status_code, 404)
 def test_tutorial_detail(self):
     tutorial = create_tutorial(status=Tutorial.LIVE)
     response = self.client.get(tutorial.get_absolute_url())
     eq_(response.status_code, 200)
     eq_(response.context['tutorial'], tutorial)
Пример #6
0
 def test_tutorial_list(self):
     tutorial = create_tutorial(status=Tutorial.LIVE)
     response = self.client.get(self.url)
     eq_(response.status_code, 200)
Пример #7
0
 def test_tutorial_detail_hidden(self):
     tutorial = create_tutorial(status=Tutorial.HIDDEN)
     response = self.client.get(tutorial.get_absolute_url())
     eq_(response.status_code, 404)
Пример #8
0
 def test_tutorial_detail(self):
     tutorial = create_tutorial(status=Tutorial.LIVE)
     response = self.client.get(tutorial.get_absolute_url())
     eq_(response.status_code, 200)
     eq_(response.context['tutorial'], tutorial)