# HG changeset patch # User Marcin Kuzminski # Date 2011-11-21 01:26:48 # Node ID 5ca2a5e9679389e715685925430795885706ee62 # Parent fee9895fa46ed3731c94c44c8022426414a4e994 fixed tests diff --git a/rhodecode/tests/functional/test_files.py b/rhodecode/tests/functional/test_files.py --- a/rhodecode/tests/functional/test_files.py +++ b/rhodecode/tests/functional/test_files.py @@ -15,11 +15,11 @@ class TestFilesController(TestController revision='tip', f_path='/')) # Test response... - assert 'docs' in response.body, 'missing dir' - assert 'tests' in response.body, 'missing dir' - assert 'vcs' in response.body, 'missing dir' - assert '.hgignore' in response.body, 'missing file' - assert 'MANIFEST.in' in response.body, 'missing file' + assert 'docs' in response.body, 'missing dir' + assert 'tests' in response.body, 'missing dir' + assert 'vcs' in response.body, 'missing dir' + assert '.hgignore' in response.body, 'missing file' + assert 'MANIFEST.in' in response.body, 'missing file' def test_index_revision(self): @@ -34,9 +34,9 @@ class TestFilesController(TestController #Test response... - assert 'docs' in response.body, 'missing dir' - assert 'tests' in response.body, 'missing dir' - assert 'README.rst' in response.body, 'missing file' + assert 'docs' in response.body, 'missing dir' + assert 'tests' in response.body, 'missing dir' + assert 'README.rst' in response.body, 'missing file' assert '1.1 KiB' in response.body, 'missing size of setup.py' assert 'text/x-python' in response.body, 'missing mimetype of setup.py' diff --git a/rhodecode/tests/test_models.py b/rhodecode/tests/test_models.py --- a/rhodecode/tests/test_models.py +++ b/rhodecode/tests/test_models.py @@ -175,29 +175,34 @@ class TestNotifications(unittest.TestCas def test_create_notification(self): usrs = [self.u1, self.u2] - notification = Notification.create(subject='subj', body='hi there', - recipients=usrs) + notification = Notification.create(created_by=self.u1, + subject='subj', body='hi there', + recipients=usrs) notifications = Session.query(Notification).all() unotification = UserNotification.query()\ .filter(UserNotification.notification == notification).all() self.assertEqual(len(notifications), 1) self.assertEqual(notifications[0].recipients, [self.u1, self.u2]) - self.assertEqual(notification, notifications[0]) + self.assertEqual(notification.notification_id, + notifications[0].notification_id) self.assertEqual(len(unotification), len(usrs)) self.assertEqual([x.user.user_id for x in unotification], [x.user_id for x in usrs]) def test_user_notifications(self): - notification1 = Notification.create(subject='subj', body='hi there', - recipients=[self.u3]) - notification2 = Notification.create(subject='subj', body='hi there', - recipients=[self.u3]) + notification1 = Notification.create(created_by=self.u1, + subject='subj', body='hi there', + recipients=[self.u3]) + notification2 = Notification.create(created_by=self.u1, + subject='subj', body='hi there', + recipients=[self.u3]) self.assertEqual(self.u3.notifications, [notification1, notification2]) def test_delete_notifications(self): - notification = Notification.create(subject='title', body='hi there3', - recipients=[self.u3, self.u1, self.u2]) + notification = Notification.create(created_by=self.u1, + subject='title', body='hi there3', + recipients=[self.u3, self.u1, self.u2]) notifications = Notification.query().all() self.assertTrue(notification in notifications)