Skip to content

Commit

Permalink
Disabled UI tests that are testing legacy templates
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones committed Sep 13, 2012
1 parent e6040c0 commit 253f820
Show file tree
Hide file tree
Showing 20 changed files with 144 additions and 46 deletions.
2 changes: 2 additions & 0 deletions ckan/tests/__init__.py
Expand Up @@ -45,6 +45,7 @@
'CkanServerCase',
]


here_dir = os.path.dirname(os.path.abspath(__file__))
conf_dir = os.path.dirname(os.path.dirname(here_dir))

Expand Down Expand Up @@ -404,3 +405,4 @@ class StatusCodes:
STATUS_404_NOT_FOUND = 404
STATUS_409_CONFLICT = 409


3 changes: 3 additions & 0 deletions ckan/tests/functional/test_activity.py
Expand Up @@ -19,6 +19,9 @@ class TestActivity(HtmlCheckMethods):
"""
@classmethod
def setup(cls):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

ckan.tests.CreateTestData.create()
cls.sysadmin_user = ckan.model.User.get('testsysadmin')
cls.app = paste.fixture.TestApp(pylonsapp)
Expand Down
14 changes: 9 additions & 5 deletions ckan/tests/functional/test_admin.py
@@ -1,11 +1,12 @@
import ckan.model as model
from ckan.tests import url_for, CreateTestData, WsgiAppCase
from nose.plugins.skip import SkipTest

class TestAdminController(WsgiAppCase):
@classmethod
def setup_class(cls):
raise SkipTest()
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")


# setup test data including testsysadmin user
CreateTestData.create()
Expand Down Expand Up @@ -34,11 +35,12 @@ class TestAdminAuthzController(WsgiAppCase):

@classmethod
def setup_class(cls):
# setup test data including testsysadmin user
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

CreateTestData.create()
model.Session.commit()

raise SkipTest()

@classmethod
def teardown_class(self):
Expand Down Expand Up @@ -160,9 +162,11 @@ def get_roles_by_name(user=None, group=None):

class TestAdminTrashController(WsgiAppCase):
def setup(cls):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

model.repo.rebuild_db()
CreateTestData.create()
raise SkipTest()

def teardown(self):
model.repo.rebuild_db()
Expand Down
8 changes: 6 additions & 2 deletions ckan/tests/functional/test_authz.py
Expand Up @@ -23,7 +23,9 @@ class AuthzTestBase(object):

@classmethod
def setup_class(self):
raise SkipTest()
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

setup_test_search_index()
self._create_test_data()
model.Session.remove()
Expand Down Expand Up @@ -592,7 +594,9 @@ class TestLockedDownViaRoles(TestController):
'''
@classmethod
def setup_class(self):
raise SkipTest()
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

model.repo.init_db()
q = model.Session.query(model.UserObjectRole) \
.filter(sa.or_(model.UserObjectRole.role==model.Role.EDITOR,
Expand Down
3 changes: 3 additions & 0 deletions ckan/tests/functional/test_edit_authz.py
Expand Up @@ -28,6 +28,9 @@ def check_and_set_checkbox(theform, user, role, should_be, set_to):
class TestEditAuthz(TestController):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

# for the authorization editing tests we set up test data so:
# three users, sysadmin , administrator, and another
# one group, one package
Expand Down
13 changes: 8 additions & 5 deletions ckan/tests/functional/test_follow.py
Expand Up @@ -9,6 +9,9 @@ class TestFollow(HtmlCheckMethods):

@classmethod
def setupClass(cls):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

ckan.tests.CreateTestData.create()
cls.testsysadmin = ckan.model.User.get('testsysadmin')
cls.annafan = ckan.model.User.get('annafan')
Expand Down Expand Up @@ -66,8 +69,8 @@ def test_dataset_read_not_logged_in(self):
assert 'href="/dataset/followers/annakarenina"' in result
assert 'Followers (3)' in result
assert 'id="dataset_follow_button"' not in result
def test_dataset_followers_not_logged_in(self):

def test_dataset_followers_not_logged_in(self):
offset = url_for(controller='package', action='followers',
id='warandpeace')
result = self.app.get(offset)
Expand Down Expand Up @@ -101,7 +104,7 @@ def test_user_read_not_logged_in(self):
assert 'href="/user/followers/annafan"' in result
assert 'Followers (2)' in result
assert 'id="user_follow_button"' not in result

def test_user_followers_not_logged_in(self):
offset = url_for(controller='user', action='followers',
id='joeadmin')
Expand Down Expand Up @@ -137,7 +140,7 @@ def test_own_user_read_logged_in(self):
assert 'href="/user/followers/annafan"' in result
assert 'My Followers (2)' in result
assert 'id="user_follow_button"' not in result

def test_own_user_followers_logged_in(self):
offset = url_for(controller='user', action='followers',
id='joeadmin')
Expand Down Expand Up @@ -205,7 +208,7 @@ def test_dataset_follow_logged_in(self):
extra_environ = {'Authorization': str(self.joeadmin.apikey)}
result = self.app.get(offset, extra_environ=extra_environ)
assert 'Unfollow' in result

def test_user_read_logged_in(self):
offset = url_for(controller='user', action='read',
id='joeadmin')
Expand Down
10 changes: 5 additions & 5 deletions ckan/tests/functional/test_group.py
Expand Up @@ -52,7 +52,7 @@ class TestGroup(FunctionalTestCase):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Use organizations instead of groups")
raise SkipTest("Disable UI tests for 2.0 branch")

model.Session.remove()
CreateTestData.create()
Expand Down Expand Up @@ -234,7 +234,7 @@ class TestGroupWithSearch(FunctionalTestCase):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Use organizations instead of groups")
raise SkipTest("Disable UI tests for 2.0 branch")

setup_test_search_index()
model.Session.remove()
Expand Down Expand Up @@ -280,7 +280,7 @@ class TestEdit(FunctionalTestCase):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Use organizations instead of groups")
raise SkipTest("Disable UI tests for 2.0 branch")

setup_test_search_index()
model.Session.remove()
Expand Down Expand Up @@ -507,7 +507,7 @@ class TestNew(FunctionalTestCase):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Use organizations instead of groups")
raise SkipTest("Disable UI tests for 2.0 branch")

model.Session.remove()
CreateTestData.create()
Expand Down Expand Up @@ -627,7 +627,7 @@ class TestRevisions(FunctionalTestCase):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Use organizations instead of groups")
raise SkipTest("Disable UI tests for 2.0 branch")

model.Session.remove()
CreateTestData.create()
Expand Down
19 changes: 14 additions & 5 deletions ckan/tests/functional/test_home.py
Expand Up @@ -13,11 +13,14 @@
class TestHomeController(TestController, PylonsTestCase, HtmlCheckMethods):
@classmethod
def setup_class(cls):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

setup_test_search_index()
PylonsTestCase.setup_class()
model.repo.init_db()
CreateTestData.create()

@classmethod
def teardown_class(self):
model.repo.rebuild_db()
Expand All @@ -36,7 +39,7 @@ def test_packages_link(self):
offset = url_for('home')
res = self.app.get(offset)
res.click('Search', index=0)

def test_template_head_end(self):
offset = url_for('home')
res = self.app.get(offset)
Expand Down Expand Up @@ -98,7 +101,7 @@ def test_template_footer_end(self):
## tag='a', href_attr='href',
## href_extract=None,
## content='Deutsch',
## id=None,
## id=None,
## href_pattern=None,
## html_pattern=None,
## index=None, verbose=False)
Expand Down Expand Up @@ -219,12 +222,15 @@ def test_update_profile_notice(self):
class TestHomeControllerWithoutSearch(TestController, PylonsTestCase, HtmlCheckMethods):
@classmethod
def setup_class(cls):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

PylonsTestCase.setup_class()

@classmethod
def teardown_class(self):
model.repo.rebuild_db()

def test_404(self):
offset = '/some_nonexistent_url'
res = self.app.get(offset, status=404)
Expand All @@ -238,6 +244,9 @@ def test_about(self):
class TestDatabaseNotInitialised(TestController):
@classmethod
def setup_class(cls):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

PylonsTestCase.setup_class()
model.repo.clean_db()

Expand Down
39 changes: 29 additions & 10 deletions ckan/tests/functional/test_package.py
Expand Up @@ -250,7 +250,9 @@ class TestReadOnly(TestPackageForm, HtmlCheckMethods, PylonsTestCase):

@classmethod
def setup_class(cls):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")


PylonsTestCase.setup_class()
CreateTestData.create()
Expand Down Expand Up @@ -403,7 +405,9 @@ class TestReadAtRevision(FunctionalTestCase, HtmlCheckMethods):

@classmethod
def setup_class(cls):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")


cls.before = datetime.datetime(2010, 1, 1)
cls.date1 = datetime.datetime(2011, 1, 1)
Expand Down Expand Up @@ -576,7 +580,8 @@ class TestEdit(TestPackageForm):

@classmethod
def setup_class(self):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

CreateTestData.create()

Expand Down Expand Up @@ -1048,7 +1053,9 @@ class TestNew(TestPackageForm):

@classmethod
def setup_class(self):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")


model.repo.init_db()
CreateTestData.create_test_user()
Expand Down Expand Up @@ -1322,7 +1329,9 @@ class TestSearch(TestPackageForm):

@classmethod
def setup_class(self):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

model.repo.init_db()

@classmethod
Expand All @@ -1346,7 +1355,9 @@ class TestNewPreview(TestPackageBase):

@classmethod
def setup_class(self):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

model.repo.init_db()

@classmethod
Expand All @@ -1358,7 +1369,9 @@ class TestNonActivePackages(TestPackageBase):

@classmethod
def setup_class(self):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")


CreateTestData.create()
self.non_active_name = u'test_nonactive'
Expand Down Expand Up @@ -1395,7 +1408,9 @@ def test_read_as_admin(self):
class TestRevisions(TestPackageBase):
@classmethod
def setup_class(cls):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

model.Session.remove()
model.repo.init_db()
cls.name = u'revisiontest1'
Expand Down Expand Up @@ -1498,7 +1513,9 @@ class TestMarkdownHtmlWhitelist(TestPackageForm):
'''

def setup(self):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")


model.Session.remove()
model.repo.init_db()
Expand Down Expand Up @@ -1534,7 +1551,9 @@ def fail_if_fragment(self, fragment):
class TestAutocomplete(PylonsTestCase, TestPackageBase):
@classmethod
def setup_class(cls):
raise SkipTest("No UI test for organization")
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

PylonsTestCase.setup_class()
CreateTestData.create()

Expand Down
3 changes: 3 additions & 0 deletions ckan/tests/functional/test_package_edit_authz.py
Expand Up @@ -8,6 +8,9 @@
class TestPackageEditAuthz(TestController):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

# for the authorization editing tests we set up test data so:
# three users, madeup-sysadmin , madeup-administrator, and madeup-another
# two packages test6 and test6a, m-a is admin on both
Expand Down
5 changes: 4 additions & 1 deletion ckan/tests/functional/test_package_relationships.py
Expand Up @@ -6,6 +6,9 @@
class TestRelationships(FunctionalTestCase):
@classmethod
def setup_class(self):
from nose import SkipTest
raise SkipTest("Disable UI tests for 2.0 branch")

create = CreateTestData
create.create_family_test_data()

Expand All @@ -27,7 +30,7 @@ def read_package(pkg_name):
self.check_named_element(res, 'li', 'is a parent of', 'lisa')
self.check_named_element(res, 'li', 'has derivation', 'homer_derived')
self.check_named_element(res, 'li', 'depends on', 'beer')

res = read_package(u'bart')
self.check_named_element(res, 'li', 'has sibling', 'lisa')
self.check_named_element(res, 'li', 'is a child of', 'homer')
Expand Down

0 comments on commit 253f820

Please sign in to comment.