本文整理汇总了Python中tests.functional.actions.simple_add_course函数的典型用法代码示例。如果您正苦于以下问题:Python simple_add_course函数的具体用法?Python simple_add_course怎么用?Python simple_add_course使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了simple_add_course函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_namespaced_handlers_404
def test_namespaced_handlers_404(self):
self.admin_email = '[email protected]'
self.prefix = 'course'
actions.login(self.admin_email, is_admin=True)
actions.simple_add_course(self.prefix, self.admin_email, 'Course')
self.assert_handlers_404(embed._NAMESPACED_HANDLERS, prefix=self.prefix)
开发者ID:mmoylan,项目名称:course-builder,代码行数:7,代码来源:modules_embed.py
示例2: test_multiple_courses
def test_multiple_courses(self):
COURSE_TWO = 'course_two'
COURSE_TWO_NS = 'ns_' + COURSE_TWO
# Slight cheat: Register gitkit data remover manually, rather than
# enabling the entire module, which disrupts normal functional test
# user login handling
gitkit.EmailMapping.register_for_data_removal()
actions.simple_add_course(
COURSE_TWO, self.ADMIN_EMAIL, 'Data Removal Test Two')
user = actions.login(self.STUDENT_EMAIL)
actions.register(self, user.email(), course=self.COURSE)
actions.register(self, user.email(), course=COURSE_TWO)
# Slight cheat: Rather than enabling gitkit module, just call
# the method that will insert the EmailMapping row.
gitkit.EmailUpdatePolicy.apply(user)
# Global profile object(s) should now exist.
profile = models.StudentProfileDAO.get_profile_by_user_id(
user.user_id())
self.assertIsNotNone(profile)
email_policy = gitkit.EmailMapping.get_by_user_id(user.user_id())
self.assertIsNotNone(email_policy)
# Unregister from 'data_removal_test' course.
self._unregister_and_request_data_removal(self.COURSE)
self._complete_removal()
# Student object should be gone from data_removal_test course, but
# not from course_two.
with common_utils.Namespace(self.NAMESPACE):
self.assertIsNone(models.Student.get_by_user(user))
with common_utils.Namespace(COURSE_TWO_NS):
self.assertIsNotNone(models.Student.get_by_user(user))
# Global profile object(s) should still exist.
profile = models.StudentProfileDAO.get_profile_by_user_id(
user.user_id())
self.assertIsNotNone(profile)
email_policy = gitkit.EmailMapping.get_by_user_id(user.user_id())
self.assertIsNotNone(email_policy)
# Unregister from other course.
self._unregister_and_request_data_removal(COURSE_TWO)
self._complete_removal()
# Both Student objects should now be gone.
with common_utils.Namespace(self.NAMESPACE):
self.assertIsNone(models.Student.get_by_user(user))
with common_utils.Namespace(COURSE_TWO_NS):
self.assertIsNone(models.Student.get_by_user(user))
# Global profile object(s) should also be gone.
profile = models.StudentProfileDAO.get_profile_by_user_id(
user.user_id())
self.assertIsNone(profile)
email_policy = gitkit.EmailMapping.get_by_user_id(user.user_id())
self.assertIsNone(email_policy)
开发者ID:google,项目名称:coursebuilder-core,代码行数:60,代码来源:data_removal_tests.py
示例3: setUp
def setUp(self):
super(StudentLabelsTest, self).setUp()
actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
with common_utils.Namespace(NAMESPACE):
self.foo_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Foo',
'descripton': 'foo',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.bar_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Bar',
'descripton': 'bar',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.baz_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Baz',
'descripton': 'baz',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.quux_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Quux',
'descripton': 'quux',
'type': models.LabelDTO.LABEL_TYPE_GENERAL}))
actions.login(REGISTERED_STUDENT_EMAIL)
actions.register(self, REGISTERED_STUDENT_NAME, COURSE_NAME)
actions.logout()
开发者ID:barkinet,项目名称:course-builder,代码行数:25,代码来源:student_labels.py
示例4: test_multiple_courses
def test_multiple_courses(self):
user = self.make_test_user(self.STUDENT_EMAIL)
COURSE_TWO = 'course_two'
COURSE_TWO_NS = 'ns_' + COURSE_TWO
actions.simple_add_course(
COURSE_TWO, self.ADMIN_EMAIL, 'Data Removal Test Two')
actions.login(user.email())
actions.register(self, user.email(), course=self.COURSE)
actions.register(self, user.email(), course=COURSE_TWO)
actions.unregister(self, self.COURSE, do_data_removal=True)
self.execute_all_deferred_tasks(
models.StudentLifecycleObserver.QUEUE_NAME)
self.get(
data_removal.DataRemovalCronHandler.URL,
headers={'X-AppEngine-Cron': 'True'})
self.execute_all_deferred_tasks()
with common_utils.Namespace(self.NAMESPACE):
self.assertIsNone(models.Student.get_by_user(user))
with common_utils.Namespace(COURSE_TWO_NS):
self.assertIsNotNone(
models.Student.get_by_user(user))
开发者ID:kingctan,项目名称:course-builder,代码行数:26,代码来源:modules_data_removal.py
示例5: setUp
def setUp(self):
super(StudentTracksTest, self).setUp()
# Add a course that will show up.
actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
# Add labels
with common_utils.Namespace(NAMESPACE):
self.foo_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Foo',
'descripton': 'foo',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.bar_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Bar',
'descripton': 'bar',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.baz_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Baz',
'descripton': 'baz',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.quux_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Quux',
'descripton': 'quux',
'type': models.LabelDTO.LABEL_TYPE_GENERAL}))
# Register a student for that course.
actions.login(REGISTERED_STUDENT_EMAIL)
actions.register(self, REGISTERED_STUDENT_NAME, COURSE_NAME)
actions.logout()
# Add some units to the course.
self._course = courses.Course(
None, app_context=sites.get_all_courses()[0])
self._unit_no_labels = self._course.add_unit()
self._unit_no_labels.title = 'Unit No Labels'
self._unit_no_labels.availability = courses.AVAILABILITY_AVAILABLE
self._course.add_lesson(self._unit_no_labels)
self._unit_labels_foo = self._course.add_unit()
self._unit_labels_foo.title = 'Unit Labels: Foo'
self._unit_labels_foo.availability = courses.AVAILABILITY_AVAILABLE
self._unit_labels_foo.labels = str(self.foo_id)
self._course.add_lesson(self._unit_labels_foo)
self._unit_labels_foo_bar = self._course.add_unit()
self._unit_labels_foo_bar.title = 'Unit Labels: Bar, Foo'
self._unit_labels_foo_bar.availability = courses.AVAILABILITY_AVAILABLE
self._unit_labels_foo_bar.labels = '%s %s' % (self.bar_id, self.foo_id)
self._course.add_lesson(self._unit_labels_foo_bar)
self._unit_labels_quux = self._course.add_unit()
self._unit_labels_quux.title = 'Unit Labels: Quux'
self._unit_labels_quux.availability = courses.AVAILABILITY_AVAILABLE
self._unit_labels_quux.labels = str(self.quux_id)
self._course.add_lesson(self._unit_labels_quux)
self._unit_labels_foo_quux = self._course.add_unit()
self._unit_labels_foo_quux.title = 'Unit Labels: Foo Quux'
self._unit_labels_foo_quux.availability = courses.AVAILABILITY_AVAILABLE
self._unit_labels_foo_quux.labels = '%s %s' % (str(self.foo_id),
str(self.quux_id))
self._course.add_lesson(self._unit_labels_foo_quux)
self._course.save()
开发者ID:2023SS,项目名称:coursebuilder-core,代码行数:59,代码来源:student_tracks.py
示例6: setUp
def setUp(self):
super(AssetsRestTest, self).setUp()
actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
actions.login(ADMIN_EMAIL, is_admin=True)
actions.update_course_config(COURSE_NAME, {
'extra_locales': [
{'locale': 'de_DE', 'availability': 'available'}]})
self.COURSE_NAME = COURSE_NAME
开发者ID:CSCI1200Course,项目名称:csci1200OnlineCourse,代码行数:8,代码来源:assets_rest.py
示例7: setUp
def setUp(self):
super(NamespacedHandlerTest, self).setUp()
self.admin_email = '[email protected]'
self.course_name = 'test_course'
self.course_title = 'Test Course'
self.namespaced_url = '/%s%s' % (
self.course_name, hello.NamespacedHandler.URL)
actions.simple_add_course(
self.course_name, self.admin_email, self.course_title)
开发者ID:basha6an,项目名称:coursebuilder-hello-world-module,代码行数:9,代码来源:functional_tests.py
示例8: setUp
def setUp(self):
super(StudentTracksTest, self).setUp()
# Add a course that will show up.
actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
# Add labels
with common_utils.Namespace(NAMESPACE):
self.foo_id = models.LabelDAO.save(
models.LabelDTO(
None, {"title": "Foo", "descripton": "foo", "type": models.LabelDTO.LABEL_TYPE_COURSE_TRACK}
)
)
self.bar_id = models.LabelDAO.save(
models.LabelDTO(
None, {"title": "Bar", "descripton": "bar", "type": models.LabelDTO.LABEL_TYPE_COURSE_TRACK}
)
)
self.baz_id = models.LabelDAO.save(
models.LabelDTO(
None, {"title": "Baz", "descripton": "baz", "type": models.LabelDTO.LABEL_TYPE_COURSE_TRACK}
)
)
self.quux_id = models.LabelDAO.save(
models.LabelDTO(
None, {"title": "Quux", "descripton": "quux", "type": models.LabelDTO.LABEL_TYPE_GENERAL}
)
)
# Register a student for that course.
actions.login(REGISTERED_STUDENT_EMAIL)
actions.register(self, REGISTERED_STUDENT_NAME, COURSE_NAME)
actions.logout()
# Add some units to the course.
self._course = courses.Course(None, app_context=sites.get_all_courses()[0])
self._unit_no_labels = self._course.add_unit()
self._unit_no_labels.title = "Unit No Labels"
self._unit_no_labels.now_available = True
self._unit_labels_foo = self._course.add_unit()
self._unit_labels_foo.title = "Unit Labels: Foo"
self._unit_labels_foo.now_available = True
self._unit_labels_foo.labels = str(self.foo_id)
self._unit_labels_foo_bar = self._course.add_unit()
self._unit_labels_foo_bar.title = "Unit Labels: Bar, Foo"
self._unit_labels_foo_bar.now_available = True
self._unit_labels_foo_bar.labels = "%s %s" % (self.bar_id, self.foo_id)
self._unit_labels_quux = self._course.add_unit()
self._unit_labels_quux.title = "Unit Labels: Quux"
self._unit_labels_quux.now_available = True
self._unit_labels_quux.labels = str(self.quux_id)
self._unit_labels_foo_quux = self._course.add_unit()
self._unit_labels_foo_quux.title = "Unit Labels: Foo Quux"
self._unit_labels_foo_quux.now_available = True
self._unit_labels_foo_quux.labels = "%s %s" % (str(self.foo_id), str(self.quux_id))
self._course.save()
开发者ID:Rosebotics,项目名称:RoseboticsWeb,代码行数:56,代码来源:student_tracks.py
示例9: setUp
def setUp(self):
super(CourseCachingTest, self).setUp()
self.app_context = actions.simple_add_course(
self.COURSE_NAME, self.ADMIN_EMAIL, 'Test Course')
self.course = courses.Course(handler=None, app_context=self.app_context)
actions.login(self.ADMIN_EMAIL)
config.Registry.test_overrides[models.CAN_USE_MEMCACHE.name] = True
开发者ID:danieldalonzo,项目名称:coursebuilder-core,代码行数:7,代码来源:model_courses.py
示例10: test_jobs_run
def test_jobs_run(self):
COURSE = 'test'
app_context = actions.simple_add_course(COURSE, ADMIN_EMAIL, 'Test')
actions.register(self, 'Joe Admin', COURSE)
config.set_report_allowed(True)
response = self.get(usage_reporting.StartReportingJobs.URL,
headers={'X-AppEngine-Cron': 'True'})
self.assertEquals(200, response.status_int)
self.assertEquals('OK.', response.body)
now = int(time.time())
self.execute_all_deferred_tasks(
models.StudentLifecycleObserver.QUEUE_NAME)
self.execute_all_deferred_tasks()
expected = [{
messaging.Message._INSTALLATION: FAKE_INSTALLATION_ID,
messaging.Message._COURSE: FAKE_COURSE_ID,
messaging.Message._TIMESTAMP: FAKE_TIMESTAMP,
messaging.Message._VERSION: os.environ['GCB_PRODUCT_VERSION'],
messaging.Message._METRIC: messaging.Message.METRIC_STUDENT_COUNT,
messaging.Message._VALUE: 1,
}, {
messaging.Message._INSTALLATION: FAKE_INSTALLATION_ID,
messaging.Message._COURSE: FAKE_COURSE_ID,
messaging.Message._TIMESTAMP: now - (now % 3600),
messaging.Message._VERSION: os.environ['GCB_PRODUCT_VERSION'],
messaging.Message._METRIC: messaging.Message.METRIC_ENROLLED,
messaging.Message._VALUE: 1,
}]
actual = MockSender.get_sent()
actual.sort(key=lambda x: x['timestamp'])
self.assertEquals(expected, actual)
sites.reset_courses()
开发者ID:barkinet,项目名称:course-builder,代码行数:33,代码来源:modules_usage_reporting.py
示例11: setUp
def setUp(self):
super(ManualProgressTest, self).setUp()
# Add a course that will show up.
context = actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
# Register a student for that course.
actions.login(REGISTERED_STUDENT_EMAIL)
actions.register(self, REGISTERED_STUDENT_NAME, COURSE_NAME)
# Add content to course
self._course = courses.Course(None, context)
self._unit_one = self._course.add_unit()
self._unit_one.title = "Unit Labels: Foo"
self._unit_one.now_available = True
self._lesson_1_1 = self._course.add_lesson(self._unit_one)
self._lesson_1_1.title = "Unit One, Lesson One"
self._lesson_1_1.now_available = True
self._lesson_1_1.manual_progress = True
self._lesson_1_2 = self._course.add_lesson(self._unit_one)
self._lesson_1_2.title = "Unit One, Lesson Two"
self._lesson_1_2.now_available = True
self._lesson_1_2.manual_progress = True
self._unit_two = self._course.add_unit()
self._unit_two.title = "Unit Labels: Foo"
self._unit_two.now_available = True
self._unit_two.manual_progress = True
self._lesson_2_1 = self._course.add_lesson(self._unit_two)
self._lesson_2_1.title = "Unit Two, Lesson One"
self._lesson_2_1.now_available = True
self._lesson_2_2 = self._course.add_lesson(self._unit_two)
self._lesson_2_2.title = "Unit Two, Lesson Two"
self._lesson_2_2.now_available = True
self._sub_assessment = self._course.add_assessment()
self._sub_assessment.now_available = True
self._toplevel_assessment = self._course.add_assessment()
self._sub_assessment.now_available = True
self._unit_three = self._course.add_unit()
self._unit_three.pre_assessment = self._sub_assessment.unit_id
self._course.save()
with common_utils.Namespace(NAMESPACE):
self.foo_id = models.LabelDAO.save(
models.LabelDTO(
None, {"title": "Foo", "descripton": "foo", "type": models.LabelDTO.LABEL_TYPE_COURSE_TRACK}
)
)
self.bar_id = models.LabelDAO.save(
models.LabelDTO(
None, {"title": "Bar", "descripton": "bar", "type": models.LabelDTO.LABEL_TYPE_COURSE_TRACK}
)
)
config.Registry.test_overrides[utils.CAN_PERSIST_ACTIVITY_EVENTS.name] = True
开发者ID:Rosebotics,项目名称:RoseboticsWeb,代码行数:60,代码来源:modules_manual_progress.py
示例12: test_descriptions
def test_descriptions(self):
context = actions.simple_add_course(
COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
course = courses.Course(None, context)
unit = course.add_unit()
unit.title = 'The Unit'
unit.availability = courses.AVAILABILITY_AVAILABLE
unit.description = UNIT_DESCRIPTION
assessment = course.add_assessment()
assessment.title = 'The Assessment'
assessment.availability = courses.AVAILABILITY_AVAILABLE
assessment.description = ASSESSMENT_DESCRIPTION
link = course.add_link()
link.title = 'The Link'
link.availability = courses.AVAILABILITY_AVAILABLE
link.description = LINK_DESCRIPTION
course.save()
actions.login(ADMIN_EMAIL)
response = self.get(BASE_URL)
self.assertIn(unit.description, response)
self.assertIn(assessment.description, response)
self.assertIn(link.description, response)
开发者ID:2023SS,项目名称:coursebuilder-core,代码行数:26,代码来源:unit_description.py
示例13: setUp
def setUp(self):
super(MathTagTests, self).setUp()
actions.login(ADMIN_EMAIL, is_admin=True)
self.base = '/' + COURSE_NAME
test_course = actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL,
'Test Course')
self.course = courses.Course(None, test_course)
math_unit = self.course.add_unit()
math_unit.title = 'math_test_unit'
no_math_unit = self.course.add_unit()
no_math_unit.title = 'no_math_test_unit'
self.math_unit_id = math_unit.unit_id
self.no_math_unit_id = no_math_unit.unit_id
no_math_lesson = self.course.add_lesson(no_math_unit)
no_math_lesson.title = 'Lesson without any mathematical formula.'
no_math_lesson.objectives = 'This lesson does not contain a math tag.'
math_lesson = self.course.add_lesson(math_unit)
math_lesson.title = 'First lesson with mathematical formula'
math_lesson.objectives = (
'<gcb-math input_type="TeX" instanceid="X99HibNGBIX4">'
'x^2+2x+1'
'</gcb-math><br>')
self.course.save()
开发者ID:2023SS,项目名称:coursebuilder-core,代码行数:29,代码来源:modules_math.py
示例14: setUp
def setUp(self):
super(CertificateCriteriaTestCase, self).setUp()
self.base = '/' + self.COURSE_NAME
context = actions.simple_add_course(
self.COURSE_NAME, self.ADMIN_EMAIL, 'Certificate Criteria')
self.old_namespace = namespace_manager.get_namespace()
namespace_manager.set_namespace('ns_%s' % self.COURSE_NAME)
self.course = courses.Course(None, context)
self.course.save()
self.TEST_USER = actions.login('[email protected]')
actions.register(self, self.TEST_USER.email())
self.student = (
models.StudentProfileDAO.get_enrolled_student_by_user_for(
self.TEST_USER, context))
# Override course.yaml settings by patching app_context.
self.get_environ_old = sites.ApplicationContext.get_environ
self.certificate_criteria = []
def get_environ_new(app_context):
environ = self.get_environ_old(app_context)
environ['certificate_criteria'] = self.certificate_criteria
return environ
sites.ApplicationContext.get_environ = get_environ_new
开发者ID:danieldalonzo,项目名称:coursebuilder-core,代码行数:27,代码来源:certificate_tests.py
示例15: setUp
def setUp(self):
super(HtmlHookTest, self).setUp()
self.app_context = actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL, COURSE_TITLE)
self.course = courses.Course(None, self.app_context)
actions.login(ADMIN_EMAIL, is_admin=True)
self.xsrf_token = crypto.XsrfTokenManager.create_xsrf_token(settings.HtmlHookRESTHandler.XSRF_ACTION)
开发者ID:gbaldera,项目名称:coursebuilder-core,代码行数:7,代码来源:admin_settings.py
示例16: setUp
def setUp(self):
super(ExtraTabsTests, self).setUp()
self.base = '/' + COURSE_NAME
app_context = actions.simple_add_course(
COURSE_NAME, ADMIN_EMAIL, 'Extra Tabs Course')
self.old_namespace = namespace_manager.get_namespace()
namespace_manager.set_namespace('ns_%s' % COURSE_NAME)
self.course = courses.Course(None, app_context)
courses.Course.ENVIRON_TEST_OVERRIDES = {
'course': {
'extra_tabs': [
{
'label': 'FAQ',
'position': 'left',
'visibility': 'all',
'url': '',
'content': 'Frequently asked questions'},
{
'label': 'Resources',
'position': 'right',
'visibility': 'student',
'url': 'http://www.example.com',
'content': 'Links to resources'}]
}
}
self.faq_url = 'modules/extra_tabs/render?index=0'
actions.login(STUDENT_EMAIL, is_admin=False)
actions.register(self, STUDENT_NAME)
开发者ID:2023SS,项目名称:coursebuilder-core,代码行数:32,代码来源:extra_tabs_tests.py
示例17: setUp
def setUp(self):
super(ManualProgressTest, self).setUp()
# Add a course that will show up.
context = actions.simple_add_course(COURSE_NAME, ADMIN_EMAIL,
COURSE_TITLE)
# Register a student for that course.
actions.login(REGISTERED_STUDENT_EMAIL)
actions.register(self, REGISTERED_STUDENT_NAME, COURSE_NAME)
# Add content to course
self._course = courses.Course(None, context)
self._unit_one = self._course.add_unit()
self._unit_one.title = 'Unit Labels: Foo'
self._unit_one.availability = courses.AVAILABILITY_AVAILABLE
self._lesson_1_1 = self._course.add_lesson(self._unit_one)
self._lesson_1_1.title = 'Unit One, Lesson One'
self._lesson_1_1.availability = courses.AVAILABILITY_AVAILABLE
self._lesson_1_1.manual_progress = True
self._lesson_1_2 = self._course.add_lesson(self._unit_one)
self._lesson_1_2.title = 'Unit One, Lesson Two'
self._lesson_1_2.availability = courses.AVAILABILITY_AVAILABLE
self._lesson_1_2.manual_progress = True
self._unit_two = self._course.add_unit()
self._unit_two.title = 'Unit Labels: Foo'
self._unit_two.availability = courses.AVAILABILITY_AVAILABLE
self._unit_two.manual_progress = True
self._lesson_2_1 = self._course.add_lesson(self._unit_two)
self._lesson_2_1.title = 'Unit Two, Lesson One'
self._lesson_2_1.availability = courses.AVAILABILITY_AVAILABLE
self._lesson_2_2 = self._course.add_lesson(self._unit_two)
self._lesson_2_2.title = 'Unit Two, Lesson Two'
self._lesson_2_2.availability = courses.AVAILABILITY_AVAILABLE
self._sub_assessment = self._course.add_assessment()
self._sub_assessment.availability = courses.AVAILABILITY_AVAILABLE
self._toplevel_assessment = self._course.add_assessment()
self._sub_assessment.availability = courses.AVAILABILITY_AVAILABLE
self._unit_three = self._course.add_unit()
self._unit_three.pre_assessment = self._sub_assessment.unit_id
self._course.save()
with common_utils.Namespace(NAMESPACE):
self.foo_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Foo',
'descripton': 'foo',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.bar_id = models.LabelDAO.save(models.LabelDTO(
None, {'title': 'Bar',
'descripton': 'bar',
'type': models.LabelDTO.LABEL_TYPE_COURSE_TRACK}))
self.overridden_environment = actions.OverriddenEnvironment(
{'course': {analytics.CAN_RECORD_STUDENT_EVENTS: 'true'}})
self.overridden_environment.__enter__()
开发者ID:2023SS,项目名称:coursebuilder-core,代码行数:60,代码来源:manual_progress_tests.py
示例18: setUp
def setUp(self):
super(AutoregisterTests, self).setUp()
self.context = actions.simple_add_course(
self.COURSE_NAME, self.ADMIN_EMAIL, 'Autoregister Course')
course = courses.Course(None, app_context=self.context)
self.unit = course.add_unit()
self.unit.now_available = True
self.lesson = course.add_lesson(self.unit)
self.lesson.now_available = True
course.save()
actions.login(self.ADMIN_EMAIL)
actions.update_course_config(
self.COURSE_NAME,
{
'course': {
'now_available': True,
'browsable': False,
},
autoregister.AUTOREGISTER_SETTINGS_SCHEMA_SECTION: {
autoregister.REDIRECT_URL: self.REDIRECT_URL,
autoregister.AUTOREGISTER_ENABLED: True,
}
})
actions.login(self.STUDENT_EMAIL)
开发者ID:disegnovitruviano,项目名称:course-builder,代码行数:26,代码来源:modules_autoregister.py
示例19: setUp
def setUp(self):
super(PiiExportTest, self).setUp()
self.app_context = actions.simple_add_course(
self.COURSE_NAME, self.ADMIN_EMAIL, 'The Course')
self.data_source_context = (
CharacterDataSource.get_context_class().build_blank_default({}, 20))
开发者ID:FilterKaapi,项目名称:course-builder,代码行数:7,代码来源:model_data_sources.py
示例20: setUp
def setUp(self):
super(MultipleChoiceTagTests, self).setUp()
self.base = '/' + COURSE_NAME
self.app_context = actions.simple_add_course(
COURSE_NAME, ADMIN_EMAIL, 'Assessment Tags')
self.namespace = 'ns_%s' % COURSE_NAME
with utils.Namespace(self.namespace):
dto = models.QuestionDTO(None, transforms.loads(self.MC_1_JSON))
self.mc_1_id = models.QuestionDAO.save(dto)
dto = models.QuestionDTO(None, transforms.loads(self.MC_2_JSON))
self.mc_2_id = models.QuestionDAO.save(dto)
dto = models.QuestionGroupDTO(
None, transforms.loads(
self.QG_1_JSON_TEMPLATE % (self.mc_1_id, self.mc_2_id)))
self.qg_1_id = models.QuestionGroupDAO.save(dto)
self.course = courses.Course(None, self.app_context)
self.assessment = self.course.add_assessment()
self.assessment.now_available = True
self.assessment.html_content = (
'<question quid="%s" weight="1" instanceid="q1"></question>'
'<question-group qgid="%s" instanceid="qg1"></question-group' % (
self.mc_1_id, self.qg_1_id))
self.course.save()
开发者ID:danieldalonzo,项目名称:coursebuilder-core,代码行数:26,代码来源:assessment_tags_tests.py
注:本文中的tests.functional.actions.simple_add_course函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论