Skip to content

Commit

Permalink
Update login tests for dashboard view
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Oct 25, 2018
1 parent 9518e6b commit b7ca833
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tcms/core/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@ def setUpTestData(cls):
author=cls.tester)

def test_when_not_logged_in_redirects_to_login(self):
self.client.logout()
response = self.client.get(reverse('core-views-index'))
self.assertRedirects(
response,
reverse('tcms-login'),
reverse('tcms-login')+'?next=/',
target_status_code=HTTPStatus.OK)

def test_when_logged_in_renders_dashboard(self):
self.client.login( # nosec:B106:hardcoded_password_funcarg
username=self.tester.username,
password='password')
response = self.client.get(reverse('core-views-index'))
self.assertContains(response, 'Test Plans')
self.assertContains(response, 'Test Runs')
Expand Down

0 comments on commit b7ca833

Please sign in to comment.