Skip to content

Commit

Permalink
test(stats): use static urls instead of reverse()
Browse files Browse the repository at this point in the history
As we use BilljobsAdminSite.get_urls to add the url the name of the url
pattern is not working when we call reverse.
  • Loading branch information
ioO committed Jun 26, 2018
1 parent f8a1ac0 commit 1557ae6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions billjobs/tests/tests_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def setUp(self):

def test_login_required(self):
'''Test redirect to admin login page'''
response = self.client.get(reverse('billjobs_statistics'), follow=True)
response = self.client.get('/admin/statistics', follow=True)
self.assertRedirects(
response, '/admin/login/?next=/billjobs/statistics/')
response, '/admin/login/?next=/admin/statistics')

def test_admin_access_stats(self):
'''Test an authenticated admin can view statistic page'''
self.client.force_login(self.admin)
response = self.client.get(
reverse('billjobs_statistics'), follow=False)
'/admin/statistics', follow=False)
self.assertEqual(response.status_code, 200)

0 comments on commit 1557ae6

Please sign in to comment.