コード例 #1
0
ファイル: test_user_endpoint.py プロジェクト: z0x010/eums
    def test_should_not_allow_unicef_viewers_to_view_users(self):
        user = UserFactory()
        self.log_unicef_viewer_in()

        response = self.client.get(ENDPOINT_URL + str(user.id) + '/')

        self.assertEqual(response.status_code, 403)
コード例 #2
0
ファイル: test_user_endpoint.py プロジェクト: z0x010/eums
    def test_should_not_allow_implementing_partner_editors_to_view_users(self):
        user = UserFactory()
        self.log_ip_editor_in()

        response = self.client.get(ENDPOINT_URL + str(user.id) + '/')

        self.assertEqual(response.status_code, 403)
コード例 #3
0
ファイル: test_user_endpoint.py プロジェクト: z0x010/eums
    def test_should_not_allow_unicef_editors_to_edit_users(self):
        user = UserFactory()
        self.log_unicef_editor_in()

        response = self.client.put(
            ENDPOINT_URL + str(user.id) + '/', {
                'id': str(user.id),
                'username': '******',
                'email': '*****@*****.**',
                'first_name': 'f name',
                'last_name': 'l name'
            })

        self.assertEqual(response.status_code, 403)