diff --git a/rhodecode/tests/functional/test_admin_notifications.py b/rhodecode/tests/functional/test_admin_notifications.py --- a/rhodecode/tests/functional/test_admin_notifications.py +++ b/rhodecode/tests/functional/test_admin_notifications.py @@ -5,9 +5,9 @@ from rhodecode.model.user import UserMod 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) @@ -19,7 +19,8 @@ class TestNotificationsController(TestCo u1 = UserModel().create_or_update(username='u1', password='qweqwe', email='u1@rhodecode.org', - name='u1', lastname='u1').user_id + firstname='u1', lastname='u1') + u1 = u1.user_id response = self.app.get(url('notifications')) self.assertTrue('''
No notifications here yet
''' @@ -58,10 +59,10 @@ class TestNotificationsController(TestCo u1 = UserModel().create_or_update(username='u1', password='qweqwe', email='u1@rhodecode.org', - name='u1', lastname='u1') + firstname='u1', lastname='u1') u2 = UserModel().create_or_update(username='u2', password='qweqwe', email='u2@rhodecode.org', - name='u2', lastname='u2') + firstname='u2', lastname='u2') # make notifications notification = NotificationModel().create(created_by=cur_user, @@ -73,13 +74,12 @@ class TestNotificationsController(TestCo u2 = User.get(u2.user_id) # check DB - get_notif = lambda un:[x.notification for x in un] + 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)) @@ -87,19 +87,15 @@ class TestNotificationsController(TestCo cur_user = User.get(cur_usr_id) self.assertEqual(cur_user.notifications, []) - -# def test_delete_browser_fakeout(self): -# response = self.app.post(url('notification', notification_id=1), params=dict(_method='delete')) - 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', - name='u1', lastname='u1') + firstname='u1', lastname='u1') u2 = UserModel().create_or_update(username='u2', password='qweqwe', email='u2@rhodecode.org', - name='u2', lastname='u2') + firstname='u2', lastname='u2') notification = NotificationModel().create(created_by=cur_user, subject=u'test', @@ -108,12 +104,3 @@ class TestNotificationsController(TestCo response = self.app.get(url('notification', notification_id=notification.notification_id)) - -# def test_show_as_xml(self): -# response = self.app.get(url('formatted_notification', notification_id=1, format='xml')) -# -# def test_edit(self): -# response = self.app.get(url('edit_notification', notification_id=1)) -# -# def test_edit_as_xml(self): -# response = self.app.get(url('formatted_edit_notification', notification_id=1, format='xml'))