Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix: rename assert function which is way more than an assert
Browse files Browse the repository at this point in the history
  • Loading branch information
ashultz0 committed Jan 13, 2022
1 parent 02a5fed commit 6ee5302
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions analytics_dashboard/courses/tests/test_views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def test_invalid_course(self):
response = self.client.get(path, follow=True)
self.assertEqual(response.status_code, 404)

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
raise NotImplementedError

@httpretty.activate
Expand All @@ -197,7 +197,7 @@ def assertViewIsValid(self, course_id):
@override_switch('display_course_name_in_nav', active=True)
def test_valid_course(self, course_id):
self.mock_course_detail(course_id)
self.assertViewIsValid(course_id)
self.getAndValidateView(course_id)

def assertValidMissingDataContext(self, context):
raise NotImplementedError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_expected_secondary_nav(self, course_id):
})
return expected

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
rv = utils.mock_engagement_activity_summary_and_trend_data()
with patch(self.presenter_method, Mock(return_value=rv)):
response = self.client.get(self.path(course_id=course_id))
Expand Down
10 changes: 5 additions & 5 deletions analytics_dashboard/courses/tests/test_views/test_enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CourseEnrollmentActivityViewTests(CourseEnrollmentViewTestMixin, TestCase)
presenter_method = \
'analytics_dashboard.courses.presenters.enrollment.CourseEnrollmentPresenter.get_summary_and_trend_data'

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
summary, enrollment_data = utils.get_mock_enrollment_summary_and_trend(course_id)
rv = summary, enrollment_data
with mock.patch(self.presenter_method, return_value=rv):
Expand Down Expand Up @@ -60,7 +60,7 @@ class CourseEnrollmentGeographyViewTests(CourseEnrollmentViewTestMixin, TestCase
def get_mock_data(self, course_id):
return utils.get_mock_api_enrollment_geography_data(course_id)

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
with mock.patch(self.presenter_method, return_value=utils.get_mock_presenter_enrollment_geography_data()):
response = self.client.get(self.path(course_id=course_id))
context = response.context
Expand Down Expand Up @@ -89,7 +89,7 @@ class CourseEnrollmentDemographicsAge(CourseEnrollmentDemographicsMixin, TestCas
presenter_method = \
'analytics_dashboard.courses.presenters.enrollment.CourseEnrollmentDemographicsPresenter.get_ages'

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
last_updated, summary, binned_ages, known_percent = utils.get_presenter_ages()
rv = last_updated, summary, binned_ages, known_percent
with mock.patch(self.presenter_method, return_value=rv):
Expand Down Expand Up @@ -128,7 +128,7 @@ class CourseEnrollmentDemographicsEducation(CourseEnrollmentDemographicsMixin, T
presenter_method = \
'analytics_dashboard.courses.presenters.enrollment.CourseEnrollmentDemographicsPresenter.get_education'

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
last_updated, summary, education_data, known_percent = utils.get_presenter_education()
rv = last_updated, summary, education_data, known_percent
with mock.patch(self.presenter_method, return_value=rv):
Expand Down Expand Up @@ -167,7 +167,7 @@ class CourseEnrollmentDemographicsGender(CourseEnrollmentDemographicsMixin, Test
presenter_method = \
'analytics_dashboard.courses.presenters.enrollment.CourseEnrollmentDemographicsPresenter.get_gender'

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
last_updated, gender_data, trend, known_percent = utils.get_presenter_gender(course_id)
rv = last_updated, gender_data, trend, known_percent
with mock.patch(self.presenter_method, return_value=rv):
Expand Down
2 changes: 1 addition & 1 deletion analytics_dashboard/courses/tests/test_views/test_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class CourseHomeViewTests(CourseViewTestMixin, TestCase):
viewname = 'courses:home'

def assertViewIsValid(self, course_id):
def getAndValidateView(self, course_id):
response = self.client.get(self.path(course_id=course_id))
self.assertEqual(response.status_code, 200)

Expand Down

0 comments on commit 6ee5302

Please sign in to comment.