def setUp(self):
     super(TestRemoveWikiWritePermissions, self).setUp()
     from course_wiki.views import get_or_create_root
     self.wiki_root = get_or_create_root()
     self.course = CourseFactory.create(org='ORG',
                                        display_name='COURSE',
                                        number='RUN')
    def setUp(self):
        """Test setup."""
        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(org='edx', number='math101', display_name='2014', metadata={'use_unique_wiki_id': 'false'})
        self.course_math101_instructor = InstructorFactory(course_key=self.course_math101.id, username='******', password='******')
        self.wiki_math101 = URLPath.create_article(self.wiki, 'math101', title='math101')

        self.client = Client()
        self.client.login(username='******', password='******')
Beispiel #3
0
    def setUp(self):

        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(org='org', number='math101', display_name='Course')
        self.course_math101_staff = [InstructorFactory(course=self.course_math101.location), StaffFactory(course=self.course_math101.location)]

        wiki_math101 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101))
        wiki_math101_page = self.create_urlpath(wiki_math101, 'Child')
        wiki_math101_page_page = self.create_urlpath(wiki_math101_page, 'Grandchild')
        self.wiki_math101_pages = [wiki_math101, wiki_math101_page, wiki_math101_page_page]
Beispiel #4
0
    def setUp(self):
        """Test setup."""
        super(TestWikiAccessMiddleware, self).setUp()

        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(org='edx', number='math101', display_name='2014', metadata={'use_unique_wiki_id': 'false'})
        self.course_math101_instructor = InstructorFactory(course_key=self.course_math101.id, username='******', password='******')
        self.wiki_math101 = URLPath.create_article(self.wiki, 'math101', title='math101')

        self.client = Client()
        self.client.login(username='******', password='******')
Beispiel #5
0
 def setUp(self):
     super(TestWikiUtils, self).setUp()
     from course_wiki.views import get_or_create_root
     from wiki.models.urlpath import URLPath
     self.wiki_root = get_or_create_root()
     self.course = CourseFactory.create(org='ORG', display_name='COURSE', number='RUN')
     self.wiki_course_root = URLPath.create_article(self.wiki_root, 'RUN', title=u"Page 0")
     self.page1 = URLPath.create_article(self.wiki_course_root, 'page1', title=u"Page 1")
     self.page2 = URLPath.create_article(self.wiki_course_root, 'page2', title=u"page 2")
     self.page11 = URLPath.create_article(self.page1, 'page11', title=u"page 1.1")
     self.page111 = URLPath.create_article(self.page11, 'page111', title=u"page 1.1.1")
     self.page112 = URLPath.create_article(self.page11, 'page112', title=u"page 1.1.2")
    def setUp(self):
        """Test setup."""
        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(
            org="edx", number="math101", display_name="2014", metadata={"use_unique_wiki_id": "false"}
        )
        self.course_math101_instructor = InstructorFactory(
            course=self.course_math101.location, username="******", password="******"
        )
        self.wiki_math101 = URLPath.create_article(self.wiki, "math101", title="math101")

        self.client = Client()
        self.client.login(username="******", password="******")
Beispiel #7
0
    def test(self):

        self.course = CourseFactory.create()
        self.wiki = get_or_create_root()

        wiki_page = self.create_urlpath(self.wiki, course_wiki_slug(self.course))
        wiki_page2 = self.create_urlpath(wiki_page, 'Child')
        wiki_page3 = self.create_urlpath(wiki_page2, 'Grandchild')

        instructor = InstructorFactory.create(course_key=self.course.id)
        self.client.login(username=instructor.username, password="******")

        response = self.client.get(reverse('course-dashboard:wiki-activity',
                kwargs={'course_id': self.course.id.to_deprecated_string()}))
        self.assertEqual(200, response.status_code)
Beispiel #8
0
    def test_get_activity(self):
        from course_wiki.views import get_or_create_root
        from course_wiki.utils import course_wiki_slug

        course = CourseFactory.create()
        wiki = get_or_create_root()

        wiki_page = self.create_urlpath(wiki, course_wiki_slug(course))
        wiki_page2 = self.create_urlpath(wiki_page, 'Child')
        _wiki_page3 = self.create_urlpath(wiki_page2, 'Grandchild')

        instructor = InstructorFactory.create(course_key=course.id)
        self.client.login(username=instructor.username, password="******")

        # TODO we should probably test something more here
        response = self.client.get(reverse('course-dashboard:wiki-activity',
                kwargs={'course_id': course.id.to_deprecated_string()}))
        self.assertEqual(200, response.status_code)
    def setUp(self):

        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(org='org', number='math101', display_name='Course', metadata={'use_unique_wiki_id': 'false'})
        self.course_math101_staff = self.create_staff_for_course(self.course_math101)

        wiki_math101 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101))
        wiki_math101_page = self.create_urlpath(wiki_math101, 'Child')
        wiki_math101_page_page = self.create_urlpath(wiki_math101_page, 'Grandchild')
        self.wiki_math101_pages = [wiki_math101, wiki_math101_page, wiki_math101_page_page]

        self.course_math101b = CourseFactory.create(org='org', number='math101b', display_name='Course', metadata={'use_unique_wiki_id': 'true'})
        self.course_math101b_staff = self.create_staff_for_course(self.course_math101b)

        wiki_math101b = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101b))
        wiki_math101b_page = self.create_urlpath(wiki_math101b, 'Child')
        wiki_math101b_page_page = self.create_urlpath(wiki_math101b_page, 'Grandchild')
        self.wiki_math101b_pages = [wiki_math101b, wiki_math101b_page, wiki_math101b_page_page]
Beispiel #10
0
    def setUp(self):

        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(org='org', number='math101', display_name='Course', metadata={'use_unique_wiki_id': 'false'})
        self.course_math101_staff = self.create_staff_for_course(self.course_math101)

        wiki_math101 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101))
        wiki_math101_page = self.create_urlpath(wiki_math101, 'Child')
        wiki_math101_page_page = self.create_urlpath(wiki_math101_page, 'Grandchild')
        self.wiki_math101_pages = [wiki_math101, wiki_math101_page, wiki_math101_page_page]

        self.course_math101b = CourseFactory.create(org='org', number='math101b', display_name='Course', metadata={'use_unique_wiki_id': 'true'})
        self.course_math101b_staff = self.create_staff_for_course(self.course_math101b)

        wiki_math101b = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101b))
        wiki_math101b_page = self.create_urlpath(wiki_math101b, 'Child')
        wiki_math101b_page_page = self.create_urlpath(wiki_math101b_page, 'Grandchild')
        self.wiki_math101b_pages = [wiki_math101b, wiki_math101b_page, wiki_math101b_page_page]
Beispiel #11
0
    def setUp(self):

        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(org='org',
                                                   number='math101',
                                                   display_name='Course')
        self.course_math101_staff = [
            InstructorFactory(course=self.course_math101.location),
            StaffFactory(course=self.course_math101.location)
        ]

        wiki_math101 = self.create_urlpath(
            self.wiki, course_wiki_slug(self.course_math101))
        wiki_math101_page = self.create_urlpath(wiki_math101, 'Child')
        wiki_math101_page_page = self.create_urlpath(wiki_math101_page,
                                                     'Grandchild')
        self.wiki_math101_pages = [
            wiki_math101, wiki_math101_page, wiki_math101_page_page
        ]
    def setUp(self):

        self.wiki = get_or_create_root()

        self.course_math101 = CourseFactory.create(
            org="org", number="math101", display_name="Course", metadata={"use_unique_wiki_id": "false"}
        )
        self.course_math101_staff = self.create_staff_for_course(self.course_math101)

        wiki_math101 = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101))
        wiki_math101_page = self.create_urlpath(wiki_math101, "Child")
        wiki_math101_page_page = self.create_urlpath(wiki_math101_page, "Grandchild")
        self.wiki_math101_pages = [wiki_math101, wiki_math101_page, wiki_math101_page_page]

        self.course_math101b = CourseFactory.create(
            org="org", number="math101b", display_name="Course", metadata={"use_unique_wiki_id": "true"}
        )
        self.course_math101b_staff = self.create_staff_for_course(self.course_math101b)

        wiki_math101b = self.create_urlpath(self.wiki, course_wiki_slug(self.course_math101b))
        wiki_math101b_page = self.create_urlpath(wiki_math101b, "Child")
        wiki_math101b_page_page = self.create_urlpath(wiki_math101b_page, "Grandchild")
        self.wiki_math101b_pages = [wiki_math101b, wiki_math101b_page, wiki_math101b_page_page]
 def setUp(self):
     super(TestRemoveWikiWritePermissions, self).setUp()
     from course_wiki.views import get_or_create_root
     self.wiki_root = get_or_create_root()
     self.course = CourseFactory.create(org='ORG', display_name='COURSE', number='RUN')