コード例 #1
0
ファイル: test_views.py プロジェクト: c0cky/mediathread
    def test_form_valid(self):
        view = RequestCourseView()
        form = RequestCourseForm()
        form.cleaned_data = {
            'name': 'Test Instructor',
            'email': '*****@*****.**',
            'uni': 'ttt123',
            'course': 'Test Course',
            'course_id': 'Test Course Id',
            'term': 'Fall',
            'year': '2014',
            'instructor': 'Test Instructor',
            'section_leader': 'Test Teachers Assistant',
            'start': datetime.now(),
            'end': datetime.now(),
            'students': 24,
            'assignments_required': True,
            'description': 'Description',
            'title': 'The Course',
            'pid': '123',
            'mid': '456',
            'type': 'action item',
            'owner': 'sdreher',
            'assigned_to': 'sdreher'
        }

        with self.settings(TASK_ASSIGNMENT_DESTINATION=None):
            view.form_valid(form)
コード例 #2
0
ファイル: urls.py プロジェクト: Bhanditz/mediathread
    auth_urls,  # see above

    # Bookmarklet + cache defeating
    url(r'^bookmarklets/(?P<path>analyze.js)$',
        'django.views.static.serve', {'document_root': bookmarklet_root},
        name='analyze-bookmarklet'),
    url(r'^nocache/\w+/bookmarklets/(?P<path>analyze.js)$',
        'django.views.static.serve', {'document_root': bookmarklet_root},
        name='nocache-analyze-bookmarklet'),
    url(r'^captcha/', include('captcha.urls')),
    (r'^comments/', include('django.contrib.comments.urls')),
    (r'^contact/',
     login_required(TemplateView.as_view(template_name="main/contact.html"))),
    (r'^course/request/success/$',
     TemplateView.as_view(template_name="main/course_request_success.html")),
    (r'^course/request/', RequestCourseView.as_view()),

    # Courseaffils
    url(r'^accounts/logged_in.js$',
        'courseaffils.views.is_logged_in',
        name='is_logged_in.js'),
    url(r'^nocache/\w+/accounts/logged_in.js$',
        'courseaffils.views.is_logged_in',
        name='nocache-is_logged_in.js'),
    (r'^crossdomain.xml$', 'django.views.static.serve', {
        'document_root': os.path.abspath(os.path.dirname(__file__)),
        'path': 'crossdomain.xml'
    }),
    url(r'^dashboard/migrate/materials/(?P<course_id>\d+)/$',
        MigrateMaterialsView.as_view(), {}, 'dashboard-migrate-materials'),
    url(r'^dashboard/migrate/$', MigrateCourseView.as_view(), {},
コード例 #3
0
ファイル: urls.py プロジェクト: appsembler/mediathread
    # Bookmarklet + cache defeating
    url(r'^bookmarklets/(?P<path>analyze.js)$', 'django.views.static.serve',
        {'document_root': bookmarklet_root}, name='analyze-bookmarklet'),
    url(r'^nocache/\w+/bookmarklets/(?P<path>analyze.js)$',
        'django.views.static.serve', {'document_root': bookmarklet_root},
        name='nocache-analyze-bookmarklet'),

    url(r'^captcha/', include('captcha.urls')),

    (r'^comments/', include('django.contrib.comments.urls')),

    (r'^contact/', login_required(
        TemplateView.as_view(template_name="main/contact.html"))),
    (r'^course/request/success/$',
     TemplateView.as_view(template_name="main/course_request_success.html")),
    (r'^course/request/', RequestCourseView.as_view()),

    # Courseaffils
    url(r'^accounts/logged_in.js$', 'courseaffils.views.is_logged_in',
        name='is_logged_in.js'),
    url(r'^nocache/\w+/accounts/logged_in.js$',
        'courseaffils.views.is_logged_in', name='nocache-is_logged_in.js'),

    (r'^crossdomain.xml$', 'django.views.static.serve',
     {'document_root': os.path.abspath(os.path.dirname(__file__)),
      'path': 'crossdomain.xml'}),

    url(r'^dashboard/migrate/materials/(?P<course_id>\d+)/$',
        MigrateMaterialsView.as_view(), {}, 'dashboard-migrate-materials'),
    url(r'^dashboard/migrate/$', MigrateCourseView.as_view(),
        {}, "dashboard-migrate"),