Files
@ 6af3e67cc576
Branch filter:
Location: kallithea/rhodecode/tests/functional/test_admin_notifications.py - annotation
6af3e67cc576
3.9 KiB
text/x-python
Add Twitter's Bootstrap 3.0.0 CSS and Javascript files, under Apache License 2.0
These files are exactly as they appear the upstream release 3.0.0 of
Bootstrap, which Twitter released under the Apache License 2.0. To extract
these files, I did the following:
I downloaded the following file:
https://github.com/twbs/bootstrap/archive/v3.0.0.zip
with sha256sum of:
$ sha256sum v3.0.0.zip
2d54f345f4abc6bf65ea648c323e9bae577e6febf755650e62555f2d7a222e17 v3.0.0.zip
And extracted from it these two files:
bootstrap-3.0.0/dist/css/bootstrap.css
bootstrap-3.0.0/dist/js/bootstrap.js
which are licensed under the Apache License 2.0.
and placed them into:
rhodecode/public/css/bootstrap.css
rhodecode/public/js/bootstrap.js
respectively.
These files are exactly as they appear the upstream release 3.0.0 of
Bootstrap, which Twitter released under the Apache License 2.0. To extract
these files, I did the following:
I downloaded the following file:
https://github.com/twbs/bootstrap/archive/v3.0.0.zip
with sha256sum of:
$ sha256sum v3.0.0.zip
2d54f345f4abc6bf65ea648c323e9bae577e6febf755650e62555f2d7a222e17 v3.0.0.zip
And extracted from it these two files:
bootstrap-3.0.0/dist/css/bootstrap.css
bootstrap-3.0.0/dist/js/bootstrap.js
which are licensed under the Apache License 2.0.
and placed them into:
rhodecode/public/css/bootstrap.css
rhodecode/public/js/bootstrap.js
respectively.
cac5109ac3b6 40b3a54391f9 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 d7488551578e cac5109ac3b6 388843a3a3c0 cac5109ac3b6 cac5109ac3b6 54687aa00724 54687aa00724 54687aa00724 d7488551578e d7488551578e 54687aa00724 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 ffd45b185016 ffd45b185016 388843a3a3c0 cac5109ac3b6 cac5109ac3b6 63e49418a4cc cac5109ac3b6 cac5109ac3b6 ffd45b185016 ffd45b185016 d7488551578e cac5109ac3b6 ffd45b185016 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 388843a3a3c0 cac5109ac3b6 cac5109ac3b6 388843a3a3c0 cac5109ac3b6 54687aa00724 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 d7488551578e cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 388843a3a3c0 54687aa00724 54687aa00724 54687aa00724 cac5109ac3b6 54687aa00724 54687aa00724 54687aa00724 54687aa00724 a45191e7c7bb cac5109ac3b6 54687aa00724 54687aa00724 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 ffd45b185016 ffd45b185016 cac5109ac3b6 ffd45b185016 ffd45b185016 cac5109ac3b6 ffd45b185016 ffd45b185016 cac5109ac3b6 ffd45b185016 ffd45b185016 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 cac5109ac3b6 ffd45b185016 ffd45b185016 ffd45b185016 | from rhodecode.tests import *
from rhodecode.model.db import Notification, User
from rhodecode.model.user import UserModel
from rhodecode.model.notification import NotificationModel
from rhodecode.model.meta import Session
class TestNotificationsController(TestController):
def tearDown(self):
for n in Notification.query().all():
inst = Notification.get(n.notification_id)
Session().delete(inst)
Session().commit()
def test_index(self):
self.log_user()
u1 = UserModel().create_or_update(username='u1', password='qweqwe',
email='u1@rhodecode.org',
firstname='u1', lastname='u1')
u1 = u1.user_id
response = self.app.get(url('notifications'))
response.mustcontain('<div class="table">No notifications here yet</div>')
cur_user = self._get_logged_user()
notif = NotificationModel().create(created_by=u1, subject=u'test_notification_1',
body=u'notification_1', recipients=[cur_user])
Session().commit()
response = self.app.get(url('notifications'))
response.mustcontain('id="notification_%s"' % notif.notification_id)
def test_delete(self):
self.log_user()
cur_user = self._get_logged_user()
u1 = UserModel().create_or_update(username='u1', password='qweqwe',
email='u1@rhodecode.org',
firstname='u1', lastname='u1')
u2 = UserModel().create_or_update(username='u2', password='qweqwe',
email='u2@rhodecode.org',
firstname='u2', lastname='u2')
# make notifications
notification = NotificationModel().create(created_by=cur_user,
subject=u'test',
body=u'hi there',
recipients=[cur_user, u1, u2])
Session().commit()
u1 = User.get(u1.user_id)
u2 = User.get(u2.user_id)
# check DB
get_notif = lambda un: [x.notification for x in un]
self.assertEqual(get_notif(cur_user.notifications), [notification])
self.assertEqual(get_notif(u1.notifications), [notification])
self.assertEqual(get_notif(u2.notifications), [notification])
cur_usr_id = cur_user.user_id
response = self.app.delete(url('notification',
notification_id=
notification.notification_id))
self.assertEqual(response.body, 'ok')
cur_user = User.get(cur_usr_id)
self.assertEqual(cur_user.notifications, [])
def test_show(self):
self.log_user()
cur_user = self._get_logged_user()
u1 = UserModel().create_or_update(username='u1', password='qweqwe',
email='u1@rhodecode.org',
firstname='u1', lastname='u1')
u2 = UserModel().create_or_update(username='u2', password='qweqwe',
email='u2@rhodecode.org',
firstname='u2', lastname='u2')
subject = u'test'
notif_body = u'hi there'
notification = NotificationModel().create(created_by=cur_user,
subject=subject,
body=notif_body,
recipients=[cur_user, u1, u2])
response = self.app.get(url('notification',
notification_id=notification.notification_id))
response.mustcontain(subject)
response.mustcontain(notif_body)
|