Ejemplo n.º 1
0
 def setUp(self):
     super(CourseSettingsTests, self).setUp()
     self.base = '/' + COURSE_NAME
     self.course_id = get_course_id(self.base)
     app_context = actions.update_course_config_as_admin(
         COURSE_NAME, ADMIN_EMAIL, {
             'course': {
                 'title': COURSE_NAME,
                 'admin_user_emails': ADMIN_EMAIL,
                 'now_available': True,
                 'browsable': True,
                 'blurb': '<p>Course Abstract</p>',
                 'instructor_details': '<p>Instructor</p>',
             },
         })
Ejemplo n.º 2
0
 def setUp(self):
     super(CourseSettingsTests, self).setUp()
     self.base = '/' + COURSE_NAME
     self.course_id = get_course_id(self.base)
     app_context = actions.update_course_config_as_admin(
         COURSE_NAME, ADMIN_EMAIL, {
             'course': {
                 'title': COURSE_NAME,
                 'admin_user_emails': ADMIN_EMAIL,
                 'now_available': True,
                 'browsable': True,
                 'blurb': '<p>Course Abstract</p>',
                 'instructor_details': '<p>Instructor</p>',
             },
         })
 def test_course_fields(self):
     app_context = actions.update_course_config_as_admin(
         self.COURSE_NAME, self.ADMIN_EMAIL, {
             'course': {
                 courses_constants.START_DATE_SETTING:
                     '2016-05-11T07:00:00.000Z',
                 courses_constants.END_DATE_SETTING:
                     '2016-10-11T07:00:00.000Z',
                 'estimated_workload': '10hrs',
                 'category_name': 'Biology',
                 'show_in_explorer': False,
             },
         })
     self.maxDiff = None
     self.assertEqual(
         self.get_response("""
         {
             course (id: "%s") {
                 startDate,
                 endDate,
                 estimatedWorkload,
                 category {name},
                 showInExplorer,
             }
         }
         """ % self.course_id),
         {
             'errors': [],
             'data': {
                 'course': {
                     'startDate': '2016-05-11T07:00:00.000Z',
                     'endDate': '2016-10-11T07:00:00.000Z',
                     'estimatedWorkload': '10hrs',
                     'category': {
                         'name': 'Biology',
                     },
                     'showInExplorer': False,
                 }
             }
         })