diff --git a/common/test/acceptance/tests/discussion/test_cohort_management.py b/common/test/acceptance/tests/discussion/test_cohort_management.py index 5ab2c2ef98..063a9f2158 100644 --- a/common/test/acceptance/tests/discussion/test_cohort_management.py +++ b/common/test/acceptance/tests/discussion/test_cohort_management.py @@ -5,7 +5,6 @@ End-to-end tests related to the cohort management on the LMS Instructor Dashboar from datetime import datetime -from path import path from pytz import UTC, utc from bok_choy.promise import EmptyPromise from nose.plugins.attrib import attr @@ -71,11 +70,6 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin self.instructor_dashboard_page.visit() self.cohort_management_page = self.instructor_dashboard_page.select_cohort_management() - test_dir = path(__file__).abspath().dirname().dirname().dirname().dirname() - self.files_path = test_dir + '/data/uploads/' - - test_dir2 = self.instructor_dashboard_page.get_asset_path('.') - def verify_cohort_description(self, cohort_name, expected_description): """ Selects the cohort with the given name and verifies the expected description is presented. @@ -323,9 +317,14 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin ) def _create_csv_file(self, filename, csv_text_as_lists): - import csv + """ + Create a csv file with the provided list of lists. + + :param filename: this is the name that will be used for the csv file. Its location will + be under the test upload data directory + :param csv_text_as_lists: provide the contents of the csv file int he form of a list of lists + """ filename = self.instructor_dashboard_page.get_asset_path(filename) - # filename = self.files_path + filename with open(filename, 'w+') as csv_file: writer = csv.writer(csv_file, quoting=csv.QUOTE_ALL) for line in csv_text_as_lists: @@ -494,10 +493,10 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin And appropriate events have been emitted """ csv_contents = [ - ['username','email','ignored_column','cohort'], - [self.instructor_name,'','June','ManualCohort1'], - ['',self.student_email,'Spring','AutoCohort1'], - [self.other_student_name,'','Fall','ManualCohort1'], + ['username', 'email', 'ignored_column', 'cohort'], + [self.instructor_name, '', 'June', 'ManualCohort1'], + ['', self.student_email, 'Spring', 'AutoCohort1'], + [self.other_student_name, '', 'Fall', 'ManualCohort1'], ] filename = "cohort_csv_both_columns_1.csv" self._create_csv_file(filename, csv_contents) @@ -536,7 +535,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin """ csv_contents = [ ['username', 'cohort'], - [self.instructor_name,'ManualCohort1'], + [self.instructor_name, 'ManualCohort1'], [self.student_name, 'AutoCohort1'], [self.other_student_name, 'ManualCohort1'], ] diff --git a/common/test/acceptance/tests/lms/test_learner_profile.py b/common/test/acceptance/tests/lms/test_learner_profile.py index d32a489451..1b27c1b8b6 100644 --- a/common/test/acceptance/tests/lms/test_learner_profile.py +++ b/common/test/acceptance/tests/lms/test_learner_profile.py @@ -604,7 +604,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest): self.assert_default_image_has_public_access(profile_page) - profile_page.upload_file(filename='cohort_users_only_username.csv') + profile_page.upload_file(filename='generic_csv.csv') self.assertEqual( profile_page.profile_image_message, "The file must be one of the following types: .gif, .png, .jpeg, .jpg." diff --git a/common/test/data/uploads/cohort_users_both_columns.csv b/common/test/data/uploads/cohort_users_both_columns.csv deleted file mode 100644 index ee13b56c7c..0000000000 --- a/common/test/data/uploads/cohort_users_both_columns.csv +++ /dev/null @@ -1,4 +0,0 @@ -username,email,ignored_column,cohort -instructor_user,,June,ManualCohort1 -,student_user@example.com,Spring,AutoCohort1 -other_student_user,,Fall,ManualCohort1 diff --git a/common/test/data/uploads/cohort_users_only_email.csv b/common/test/data/uploads/cohort_users_only_email.csv deleted file mode 100644 index 7fb6a85400..0000000000 --- a/common/test/data/uploads/cohort_users_only_email.csv +++ /dev/null @@ -1,5 +0,0 @@ -email,cohort -instructor_user@example.com,ManualCohort1 -student_user@example.com,AutoCohort1 -other_student_user@example.com,ManualCohort1 - diff --git a/common/test/data/uploads/cohort_users_only_username.csv b/common/test/data/uploads/cohort_users_only_username.csv deleted file mode 100644 index f33b77a0a2..0000000000 --- a/common/test/data/uploads/cohort_users_only_username.csv +++ /dev/null @@ -1,4 +0,0 @@ -username,cohort -instructor_user,ManualCohort1 -student_user,AutoCohort1 -other_student_user,ManualCohort1 diff --git a/common/test/data/uploads/generic_csv.csv b/common/test/data/uploads/generic_csv.csv new file mode 100644 index 0000000000..bad83f6563 --- /dev/null +++ b/common/test/data/uploads/generic_csv.csv @@ -0,0 +1,7 @@ +column_1,column_2 +foo,bar +foo,baz +hello,there +file_size,must_be_100_bytes +the story,was +very very very very very,interesting