# HG changeset patch # User Thomas De Schampheleire # Date 1457731204 -3600 # Node ID 44835b81c956cb83bc16fa831ab24d7d31b2f132 # Parent ebf5f02f13e27840e0ac8f5364491015842f54b9 test_admin_notifications: fix index test dependency The index test only worked because another test had prepared some database state it relied on. More specifically, the index test creates a notification as a newly created user, but that user had not been committed to the database yet. When running the index test standalone, this causes the error: IntegrityError: (IntegrityError) NOT NULL constraint failed: notifications.created_by u'INSERT INTO notifications (subject, body, created_by, created_on, type) VALUES (?, ?, ?, ?, ?)' (u'test_notification_1', u'notification_1', None, '2016-03-11 21:15:19.066402', u'message') By committing the database after the user is created, the problem is solved. diff -r ebf5f02f13e2 -r 44835b81c956 kallithea/tests/functional/test_admin_notifications.py --- a/kallithea/tests/functional/test_admin_notifications.py Thu Mar 24 15:03:59 2016 +0000 +++ b/kallithea/tests/functional/test_admin_notifications.py Fri Mar 11 22:20:04 2016 +0100 @@ -18,6 +18,7 @@ email='u1@example.com', firstname=u'u1', lastname=u'u1') u1 = u1.user_id + Session().commit() response = self.app.get(url('notifications')) response.mustcontain('
No notifications here yet
')