Skip to content

Commit

Permalink
Remove deprecated test, CKAN does not redirect to login on forbidden …
Browse files Browse the repository at this point in the history
…error
  • Loading branch information
fdelavega committed Dec 26, 2017
1 parent cf34e24 commit dc3ac3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
OAuth2 CKAN extension [![Build Status](https://build.conwet.fi.upm.es/jenkins/buildStatus/icon?job=ckan_oauth2)](https://build.conwet.fi.upm.es/jenkins/job/ckan_oauth2/)
OAuth2 CKAN extension [![Build Status](https://travis-ci.org/conwetlab/ckanext-oauth2.svg?branch=fiware_migration)](https://travis-ci.org/conwetlab/ckanext-oauth2.svg?branch=fiware_migration) [![Coverage Status](https://coveralls.io/repos/github/conwetlab/ckanext-oauth2/badge.svg?branch=fiware_migration)](https://coveralls.io/github/conwetlab/ckanext-oauth2?branch=fiware_migration)
=====================

The OAuth2 extension allows site visitors to login through an OAuth2 server.

**Note**: This extension has been tested in CKAN 2.2 and 2.3. It may not work in other versions.
**Note**: This extension is being tested in CKAN 2.6 and 2.7. These are therefore considered as the supported versions

**Note**: If you want to use the FIWARE IdM, use the code on `fiware-migration` branch.

Expand Down
27 changes: 2 additions & 25 deletions ckanext/oauth2/tests/test_selenium.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright (c) 2014 CoNWeT Lab., Universidad Politécnica de Madrid
# Copyright (c) 2014 - 2017 CoNWeT Lab., Universidad Politécnica de Madrid

# This file is part of OAuth2 CKAN Extension.

Expand Down Expand Up @@ -115,13 +115,6 @@ def test_basic_login_different_referer(self):
self.assertEqual("filab2 Example User", driver.find_element_by_css_selector("span.username").text)
self.assertEqual(self.base_url + "dataset", driver.current_url)

# def test_user_denies_ckan_access_to_their_account(self):
# # User rejects the application to access his/her information
# driver = self.driver
# self._log_in(self.base_url, FILAB3_MAIL)
# driver.find_element_by_name("cancel").click()
# assert driver.find_element_by_xpath("//div/div/div/div").text.startswith("The end-user or authorization server denied the request.")

def test_user_access_unauthorized_page(self):
driver = self.driver
self._log_in(self.base_url)
Expand All @@ -133,23 +126,6 @@ def test_user_access_unauthorized_page(self):
# Check that an error message is shown
assert driver.find_element_by_xpath("//div/div/div/div").text.startswith("Need to be system administrator to administer")

def test_user_access_unauthorized_page_not_logged(self):
driver = self.driver
driver.get(self.base_url + "ckan-admin")

# Check that the user has been redirected to the log in page
# self.assertEquals(IDM_URL + "/users/sign_in", driver.current_url)
assert driver.current_url.startswith(IDM_URL + "/oauth2/authorize")

# Log in the user
self._introduce_log_in_parameters()

if driver.current_url.startswith(IDM_URL):
driver.find_element_by_xpath("//button[@type='submit']").click()

# Check that the user is logged in now
self.assertEqual("filab2 Example User", driver.find_element_by_css_selector("span.username").text)

def test_register_btn(self):
driver = self.driver
driver.get(self.base_url)
Expand All @@ -166,5 +142,6 @@ def test_register(self, action, expected_url):
time.sleep(3) # Wait the OAuth2 Server to return the page
self.assertEqual(expected_url, driver.current_url)


if __name__ == "__main__":
unittest.main()

0 comments on commit dc3ac3c

Please sign in to comment.