Skip to content

Commit

Permalink
[test_package web] Updated another test class to use flexible tags.
Browse files Browse the repository at this point in the history
# HG changeset patch
# User Ian Murray <ian.murray@okfn.org>
# Date 1321268339 0
# Branch feature-1453-flexible-tag-names
# Node ID 4888e657f8bdc1adb3496ddfbf9c6225068bd65d
# Parent  480d6ce5a475c1e6b66fa5ccf2393a13e5630e59
  • Loading branch information
icmurray committed Nov 14, 2011
1 parent d541dd7 commit c2014e8
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions ckan/tests/functional/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def setup_class(cls):
rev.timestamp = cls.date2
pkg = model.Package.by_name(cls.pkg_name)
pkg.title = u'title2'
pkg.add_tag_by_name(u'tag2')
pkg.add_tag_by_name(u'tag 2')
pkg.extras = {'key2': u'value2'}
model.repo.commit_and_remove()

Expand All @@ -428,7 +428,7 @@ def setup_class(cls):
rev.timestamp = cls.date3
pkg = model.Package.by_name(cls.pkg_name)
pkg.title = u'title3'
pkg.add_tag_by_name(u'tag3')
pkg.add_tag_by_name(u'tag3!')
pkg.extras['key2'] = u'value3'
model.repo.commit_and_remove()

Expand All @@ -452,8 +452,8 @@ def test_read_normally(self):
assert 'key2' in pkg_html
assert 'value3' in pkg_html
print 'SIDE', side_html
assert 'tag3' in side_html
assert 'tag2' in side_html
assert 'tag3!' in side_html
assert 'tag 2' in side_html

def test_read_date1(self):
offset = self.offset + self.date1.strftime('@%Y-%m-%d')
Expand All @@ -463,8 +463,8 @@ def test_read_date1(self):
assert 'title1' in res, res
assert 'key2' not in pkg_html, pkg_html
assert 'value3' not in pkg_html, pkg_html
assert 'tag3' not in side_html, side_html
assert 'tag2' not in side_html, side_html
assert 'tag3!' not in side_html, side_html
assert 'tag 2' not in side_html, side_html

def test_read_date2(self):
date2_plus_3h = self.date2 + datetime.timedelta(hours=3)
Expand All @@ -477,8 +477,8 @@ def test_read_date2(self):
assert 'key2' in pkg_html
assert 'value2' in pkg_html
print 'SIDE', side_html
assert 'tag3' not in side_html
assert 'tag2' in side_html
assert 'tag3!' not in side_html
assert 'tag 2' in side_html

def test_read_date3(self):
offset = self.offset + self.date3.strftime('@%Y-%m-%d-%H-%M')
Expand All @@ -490,8 +490,8 @@ def test_read_date3(self):
assert 'key2' in pkg_html
assert 'value3' in pkg_html
print 'SIDE', side_html
assert 'tag3' in side_html
assert 'tag2' in side_html
assert 'tag3!' in side_html
assert 'tag 2' in side_html

def test_read_date_before_created(self):
offset = self.offset + self.before.strftime('@%Y-%m-%d')
Expand Down Expand Up @@ -520,8 +520,8 @@ def test_read_revision1(self):
assert 'key2' not in pkg_html
assert 'value3' not in pkg_html
print 'SIDE', side_html
assert 'tag3' not in side_html
assert 'tag2' not in side_html
assert 'tag3!' not in side_html
assert 'tag 2' not in side_html

def test_read_revision2(self):
offset = self.offset + '@%s' % self.revision_ids[1]
Expand All @@ -538,8 +538,8 @@ def test_read_revision2(self):
assert 'key2' in pkg_html
assert 'value2' in pkg_html
print 'SIDE', side_html
assert 'tag3' not in side_html
assert 'tag2' in side_html
assert 'tag3!' not in side_html
assert 'tag 2' in side_html

def test_read_revision3(self):
offset = self.offset + '@%s' % self.revision_ids[2]
Expand All @@ -557,8 +557,8 @@ def test_read_revision3(self):
assert 'key2' in pkg_html
assert 'value3' in pkg_html
print 'SIDE', side_html
assert 'tag3' in side_html
assert 'tag2' in side_html
assert 'tag3!' in side_html
assert 'tag 2' in side_html

def test_read_bad_revision(self):
# this revision doesn't exist in the db
Expand Down

0 comments on commit c2014e8

Please sign in to comment.