##// END OF EJS Templates
Update minified YUI to version 2.9 built from Source....
Update minified YUI to version 2.9 built from Source. yui.2.9.js used to be a minified version of YUI 2.9 until 5143b8df576c updated it to something else and applied more aggresive minification. We stick to a clean but minified version 2.9. The license of YUI is BSD 3-clause, as described on http://yuilibrary.com/license/ . Since the minified version combines with GPLv3'd Javascript, it is only GPLv3'd compliant to distribute this Object Code version with the Corresponding Source (or offer therefor). This yui.2.9.js is built from Source this way: git clone https://github.com/yui/builder git clone https://github.com/yui/yui2 cd yui2/ git checkout hudson-yui2-2800 ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing rm -f tmp.js for m in yahoo event dom connection animation dragdrop element datasource autocomplete container event-delegate json datatable paginator; do rm -f build/$m/$m.js; ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js done java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js The source is mirrored and available on https://kallithea-scm.org/repos/mirror .

File last commit:

r4089:a5888ca7 default
r4131:31f510a8 rhodecode-2.2.5-gpl
Show More
test_changeset_comments.py
153 lines | 6.0 KiB | text/x-python | PythonLexer
/ rhodecode / tests / functional / test_changeset_comments.py
tests for changeset comments
r1715 from rhodecode.tests import *
from rhodecode.model.db import ChangesetComment, Notification, User, \
UserNotification
synced vcs with upstream...
r3797 from rhodecode.model.meta import Session
tests for changeset comments
r1715
Mysql fixes...
r2149
class TestChangeSetCommentsController(TestController):
tests for changeset comments
r1715
def setUp(self):
for x in ChangesetComment.query().all():
synced vcs with upstream...
r3797 Session().delete(x)
Session().commit()
tests for changeset comments
r1715
for x in Notification.query().all():
synced vcs with upstream...
r3797 Session().delete(x)
Session().commit()
tests for changeset comments
r1715
def tearDown(self):
for x in ChangesetComment.query().all():
synced vcs with upstream...
r3797 Session().delete(x)
Session().commit()
tests for changeset comments
r1715
for x in Notification.query().all():
synced vcs with upstream...
r3797 Session().delete(x)
Session().commit()
tests for changeset comments
r1715
def test_create(self):
self.log_user()
rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
text = u'CommentOnRevision'
Mysql fixes...
r2149 params = {'text': text}
tests for changeset comments
r1715 response = self.app.post(url(controller='changeset', action='comment',
repo_name=HG_REPO, revision=rev),
params=params)
# Test response...
self.assertEqual(response.status, '302 Found')
response.follow()
response = self.app.get(url(controller='changeset', action='index',
repo_name=HG_REPO, revision=rev))
# test DB
self.assertEqual(ChangesetComment.query().count(), 1)
Fixed tests for new i18n changes...
r2317 response.mustcontain('''<div class="comments-number">%s comment '''
'''(0 inline)</div>''' % 1)
tests for changeset comments
r1715
Mysql fixes...
r2149 self.assertEqual(Notification.query().count(), 1)
self.assertEqual(ChangesetComment.query().count(), 1)
tests for changeset comments
r1715
notification = Notification.query().all()[0]
Mysql fixes...
r2149 ID = ChangesetComment.query().first().comment_id
White space cleanup
r2150 self.assertEqual(notification.type_,
Mysql fixes...
r2149 Notification.TYPE_CHANGESET_COMMENT)
sbj = (u'/vcs_test_hg/changeset/'
'27cd5cce30c96924232dffcd24178a07ffeb5dfc#comment-%s' % ID)
print "%s vs %s" % (sbj, notification.subject)
self.assertTrue(sbj in notification.subject)
tests for changeset comments
r1715
def test_create_inline(self):
self.log_user()
rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
text = u'CommentOnRevision'
f_path = 'vcs/web/simplevcs/views/repository.py'
line = 'n1'
Mysql fixes...
r2149 params = {'text': text, 'f_path': f_path, 'line': line}
tests for changeset comments
r1715 response = self.app.post(url(controller='changeset', action='comment',
repo_name=HG_REPO, revision=rev),
params=params)
# Test response...
self.assertEqual(response.status, '302 Found')
response.follow()
response = self.app.get(url(controller='changeset', action='index',
repo_name=HG_REPO, revision=rev))
#test DB
self.assertEqual(ChangesetComment.query().count(), 1)
fixed tests
r2194 response.mustcontain(
Fixed tests for new i18n changes...
r2317 '''<div class="comments-number">0 comments'''
fixed tests
r2194 ''' (%s inline)</div>''' % 1
)
response.mustcontain(
'''<div style="display:none" class="inline-comment-placeholder" '''
'''path="vcs/web/simplevcs/views/repository.py" '''
'''target_id="vcswebsimplevcsviewsrepositorypy">'''
)
tests for changeset comments
r1715
self.assertEqual(Notification.query().count(), 1)
Mysql fixes...
r2149 self.assertEqual(ChangesetComment.query().count(), 1)
tests for changeset comments
r1715
Mysql fixes...
r2149 notification = Notification.query().all()[0]
ID = ChangesetComment.query().first().comment_id
White space cleanup
r2150 self.assertEqual(notification.type_,
Mysql fixes...
r2149 Notification.TYPE_CHANGESET_COMMENT)
sbj = (u'/vcs_test_hg/changeset/'
'27cd5cce30c96924232dffcd24178a07ffeb5dfc#comment-%s' % ID)
print "%s vs %s" % (sbj, notification.subject)
self.assertTrue(sbj in notification.subject)
tests for changeset comments
r1715
def test_create_with_mention(self):
self.log_user()
rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
text = u'@test_regular check CommentOnRevision'
params = {'text':text}
response = self.app.post(url(controller='changeset', action='comment',
repo_name=HG_REPO, revision=rev),
params=params)
# Test response...
self.assertEqual(response.status, '302 Found')
response.follow()
response = self.app.get(url(controller='changeset', action='index',
repo_name=HG_REPO, revision=rev))
# test DB
self.assertEqual(ChangesetComment.query().count(), 1)
Fixed tests for new i18n changes...
r2317 response.mustcontain('''<div class="comments-number">%s '''
'''comment (0 inline)</div>''' % 1)
tests for changeset comments
r1715
self.assertEqual(Notification.query().count(), 2)
users = [x.user.username for x in UserNotification.query().all()]
Fixed spelling of get's to gets
r4089 # test_regular gets notification by @mention
- refactoring to overcome poor usage of global pylons config...
r1723 self.assertEqual(sorted(users), [u'test_admin', u'test_regular'])
tests for changeset comments
r1715
def test_delete(self):
self.log_user()
rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
text = u'CommentOnRevision'
Mysql fixes...
r2149 params = {'text': text}
tests for changeset comments
r1715 response = self.app.post(url(controller='changeset', action='comment',
repo_name=HG_REPO, revision=rev),
params=params)
comments = ChangesetComment.query().all()
self.assertEqual(len(comments), 1)
comment_id = comments[0].comment_id
self.app.delete(url(controller='changeset',
action='delete_comment',
repo_name=HG_REPO,
- refactoring to overcome poor usage of global pylons config...
r1723 comment_id=comment_id))
tests for changeset comments
r1715
comments = ChangesetComment.query().all()
self.assertEqual(len(comments), 0)
response = self.app.get(url(controller='changeset', action='index',
repo_name=HG_REPO, revision=rev))
Fixed tests for new i18n changes...
r2317 response.mustcontain('''<div class="comments-number">0 comments'''
''' (0 inline)</div>''')