Example #1
0
def test_calendar_user_view_add(transactional_db, admin_client, client, admin_user, rf, appointment_fixtures,
                                admin_user_profile, nf_manager):
    """Test Function to check add calendar_setting"""
    calendarsetting = CalendarSettingFactory.create(user=admin_user)
    calendarsetting.save()
    request = rf.get(reverse('calendar_user_add'))
    request.user = admin_user
    request.session = {}
    resp = calendar_user_add(request)
    assert resp.status_code == 200

    resp = admin_client.post(reverse('calendar_user_add'), data=
        {
            "username": "******",
            "password1": "password",
            "password2": "password",
            "calendar_setting_id": calendarsetting.id,
        }, follow=True)
    assert resp.status_code == 200

    request = rf.post(reverse('calendar_user_add'),
        {
            "username": "******",
            "password1": "password",
            "password2": "password",
            "calendar_setting_id": calendarsetting.id,
        }, follow=True)
    request.user = admin_user
    request.session = {}
    resp = calendar_user_add(request)
    assert resp.status_code == 200
Example #2
0
    def test_calendar_user_view_add(self):
        """Test Function to check add calendar_setting"""
        request = self.factory.get('/module/calendar_user/add/')
        request.user = self.user
        request.session = {}
        response = calendar_user_add(request)
        self.assertEqual(response.status_code, 200)

        response = self.client.post('/module/calendar_user/add/', data=
            {
                "username": "******",
                "password": "******",
                "calendar_setting_id": 1,
            }, follow=True)
        self.assertEqual(response.status_code, 200)

        request = self.factory.post('/module/calendar_user/add/',
            {
                "username": "******",
                "password": "******",
                "calendar_setting_id": 1
            }, follow=True)
        request.user = self.user
        request.session = {}
        response = calendar_user_add(request)
        self.assertEqual(response.status_code, 200)
Example #3
0
    def test_calendar_user_view_add(self):
        """Test Function to check add calendar_setting"""
        request = self.factory.get('/module/calendar_user/add/')
        request.user = self.user
        request.session = {}
        response = calendar_user_add(request)
        self.assertEqual(response.status_code, 200)

        response = self.client.post('/module/calendar_user/add/',
                                    data={
                                        "username": "******",
                                        "password": "******",
                                        "calendar_setting_id": 1,
                                    },
                                    follow=True)
        self.assertEqual(response.status_code, 200)

        request = self.factory.post('/module/calendar_user/add/', {
            "username": "******",
            "password": "******",
            "calendar_setting_id": 1
        },
                                    follow=True)
        request.user = self.user
        request.session = {}
        response = calendar_user_add(request)
        self.assertEqual(response.status_code, 200)
Example #4
0
def test_calendar_user_view_add(transactional_db, admin_client, client,
                                admin_user, rf, appointment_fixtures,
                                admin_user_profile, nf_manager):
    """Test Function to check add calendar_setting"""
    calendarsetting = CalendarSettingFactory.create(user=admin_user)
    calendarsetting.save()
    request = rf.get(reverse('calendar_user_add'))
    request.user = admin_user
    request.session = {}
    resp = calendar_user_add(request)
    assert resp.status_code == 200

    resp = admin_client.post(reverse('calendar_user_add'),
                             data={
                                 "username": "******",
                                 "password1": "password",
                                 "password2": "password",
                                 "calendar_setting_id": calendarsetting.id,
                             },
                             follow=True)
    assert resp.status_code == 200

    request = rf.post(reverse('calendar_user_add'), {
        "username": "******",
        "password1": "password",
        "password2": "password",
        "calendar_setting_id": calendarsetting.id,
    },
                      follow=True)
    request.user = admin_user
    request.session = {}
    resp = calendar_user_add(request)
    assert resp.status_code == 200