Пример #1
0
    def test_allow_join(self):
        email_1, password_1 = signup_teacher_directly()
        email_2, password_2 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)
        _, class_name, access_code = create_class_directly(email_1)
        create_school_student_directly(access_code)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium)\
            .go_to_login_page()\
            .login_no_school(email_2, password_2)\
            .join_organisation(name)

        assert page.__class__.__name__ == 'OnboardingRevokeRequestPage'

        page = page \
            .logout() \
            .go_to_login_page() \
            .login(email_1, password_1)

        assert page.has_join_request(email_2)
        page = page.accept_join_request()

        assert not page.has_join_request(email_2)

        page = page \
            .logout() \
            .go_to_login_page() \
            .login_no_class(email_2, password_2)

        assert page.__class__.__name__ == 'OnboardingClassesPage'
Пример #2
0
    def test_kick(self):
        email_1, password_1 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)
        _, class_name, access_code = create_class_directly(email_1)
        create_school_student_directly(access_code)

        title, first_name, last_name, email_2, password_2 = generate_details()

        new_last_name = "New Teacher"

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium) \
            .go_to_signup_page() \
            .signup(title, first_name, new_last_name, email_2, password_2, password_2)

        assert page.__class__.__name__ == 'EmailVerificationNeededPage'

        page = email_utils.follow_verify_email_link_to_onboarding(
            page, mail.outbox[0])
        mail.outbox = []

        page = page.login_no_school(email_2,
                                    password_2).join_organisation(name)

        assert page.__class__.__name__ == 'OnboardingRevokeRequestPage'

        page = page \
            .logout() \
            .go_to_login_page() \
            .login(email_1, password_1)

        page = page.accept_join_request()

        assert page.is_teacher_in_school(new_last_name)

        page = page.click_kick_button().confirm_dialog()

        assert page.is_not_teacher_in_school(new_last_name)