Skip to content

Commit

Permalink
Removed some unnecessary mocking from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Mar 4, 2016
1 parent deb888a commit f08893e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions casepro/cases/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,7 @@ def test_timeline(self, mock_create_outgoing, mock_fetch_contact_messages, mock_


class HomeViewsTest(BaseCasesTest):
@patch('dash.orgs.models.TembaClient1.get_labels')
def test_inbox(self, mock_get_labels):
mock_get_labels.return_value = []

def test_inbox(self):
url = reverse('cases.inbox')

response = self.url_get('unicef', url)
Expand Down
7 changes: 1 addition & 6 deletions casepro/profiles/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,12 @@ def test_self(self):

class ForcePasswordChangeMiddlewareTest(BaseCasesTest):
@override_settings(CELERY_ALWAYS_EAGER=True, CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, BROKER_BACKEND='memory')
@patch('dash.orgs.models.TembaClient1.get_labels')
def test_process_view(self, mock_get_labels):
mock_get_labels.return_value = []

def test_process_view(self):
self.user1.profile.change_password = True
self.user1.profile.save()

self.login(self.user1)

# TODO figure out why fetch_redirect_response=False became necessary after Dash update

response = self.url_get('unicef', reverse('cases.inbox'))
self.assertRedirects(response, 'http://unicef.localhost/profile/self/', fetch_redirect_response=False)

Expand Down

0 comments on commit f08893e

Please sign in to comment.