Show More
@@ -15,11 +15,11 b' class TestFilesController(TestController' | |||
|
15 | 15 | revision='tip', |
|
16 | 16 | f_path='/')) |
|
17 | 17 | # Test response... |
|
18 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>' in response.body, 'missing dir' | |
|
19 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>' in response.body, 'missing dir' | |
|
20 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>' in response.body, 'missing dir' | |
|
21 | assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>' in response.body, 'missing file' | |
|
22 | assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>' in response.body, 'missing file' | |
|
18 | assert '<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>' in response.body, 'missing dir' | |
|
19 | assert '<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>' in response.body, 'missing dir' | |
|
20 | assert '<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>' in response.body, 'missing dir' | |
|
21 | assert '<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>' in response.body, 'missing file' | |
|
22 | assert '<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>' in response.body, 'missing file' | |
|
23 | 23 | |
|
24 | 24 | |
|
25 | 25 | def test_index_revision(self): |
@@ -34,9 +34,9 b' class TestFilesController(TestController' | |||
|
34 | 34 | |
|
35 | 35 | #Test response... |
|
36 | 36 | |
|
37 | assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>' in response.body, 'missing dir' | |
|
38 | assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>' in response.body, 'missing dir' | |
|
39 | assert '<a class="browser-file" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>' in response.body, 'missing file' | |
|
37 | assert '<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>' in response.body, 'missing dir' | |
|
38 | assert '<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>' in response.body, 'missing dir' | |
|
39 | assert '<a class="browser-file ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>' in response.body, 'missing file' | |
|
40 | 40 | assert '1.1 KiB' in response.body, 'missing size of setup.py' |
|
41 | 41 | assert 'text/x-python' in response.body, 'missing mimetype of setup.py' |
|
42 | 42 |
@@ -175,29 +175,34 b' class TestNotifications(unittest.TestCas' | |||
|
175 | 175 | |
|
176 | 176 | def test_create_notification(self): |
|
177 | 177 | usrs = [self.u1, self.u2] |
|
178 |
notification = Notification.create( |
|
|
179 | recipients=usrs) | |
|
178 | notification = Notification.create(created_by=self.u1, | |
|
179 | subject='subj', body='hi there', | |
|
180 | recipients=usrs) | |
|
180 | 181 | |
|
181 | 182 | notifications = Session.query(Notification).all() |
|
182 | 183 | unotification = UserNotification.query()\ |
|
183 | 184 | .filter(UserNotification.notification == notification).all() |
|
184 | 185 | self.assertEqual(len(notifications), 1) |
|
185 | 186 | self.assertEqual(notifications[0].recipients, [self.u1, self.u2]) |
|
186 |
self.assertEqual(notification, |
|
|
187 | self.assertEqual(notification.notification_id, | |
|
188 | notifications[0].notification_id) | |
|
187 | 189 | self.assertEqual(len(unotification), len(usrs)) |
|
188 | 190 | self.assertEqual([x.user.user_id for x in unotification], |
|
189 | 191 | [x.user_id for x in usrs]) |
|
190 | 192 | |
|
191 | 193 | def test_user_notifications(self): |
|
192 |
notification1 = Notification.create( |
|
|
193 | recipients=[self.u3]) | |
|
194 | notification2 = Notification.create(subject='subj', body='hi there', | |
|
195 | recipients=[self.u3]) | |
|
194 | notification1 = Notification.create(created_by=self.u1, | |
|
195 | subject='subj', body='hi there', | |
|
196 | recipients=[self.u3]) | |
|
197 | notification2 = Notification.create(created_by=self.u1, | |
|
198 | subject='subj', body='hi there', | |
|
199 | recipients=[self.u3]) | |
|
196 | 200 | self.assertEqual(self.u3.notifications, [notification1, notification2]) |
|
197 | 201 | |
|
198 | 202 | def test_delete_notifications(self): |
|
199 |
notification = Notification.create( |
|
|
200 | recipients=[self.u3, self.u1, self.u2]) | |
|
203 | notification = Notification.create(created_by=self.u1, | |
|
204 | subject='title', body='hi there3', | |
|
205 | recipients=[self.u3, self.u1, self.u2]) | |
|
201 | 206 | notifications = Notification.query().all() |
|
202 | 207 | self.assertTrue(notification in notifications) |
|
203 | 208 |
General Comments 0
You need to be logged in to leave comments.
Login now