def test_notification_email(self): send_notifications( self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find({'subject': u'[test:src-git] New commit [1e146e] by Rick Copeland'}).first() assert n assert_in('Change README', n.text)
def test_notification_email(self): send_notifications( self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find({'subject': '[test:src-git] New commit [1e146e] by Rick Copeland'}).first() assert n assert_in('Change README', n.text)
def test_notification_email_multiple_commits(self): send_notifications(self.repo, ['df30427c488aeab84b2352bdf88a3b19223f9d7a', '1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject='[test:src-git] 2 new commits to Git')).first() assert n assert n.text.startswith('\n## Branch: master'), n.text assert n.text.find('Add README') < n.text.find('Change README'), n.text
def test_notification_email_multiple_commits(self): send_notifications(self.repo, ['df30427c488aeab84b2352bdf88a3b19223f9d7a', '1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject=u'[test:src-git] 2 new commits to Git')).first() assert n assert n.text.startswith('\n## Branch: master'), n.text assert n.text.find('Add README') < n.text.find('Change README'), n.text
def test_notification_email(self): send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject='[test:src-git] [1e146e] - Rick Copeland: Change README')).first() assert n assert 'master: ' in n.text, n.text send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a']) ThreadLocalORMSession.flush_all() assert M.Notification.query.find( dict(subject='[test:src-git] 2 new commits to Test Project Git')).first()
def test_notification_email_max_commits(self): send_notifications(self.repo, ['9a7df788cf800241e3bb5a849c8870f2f8259d98', '6a45885ae7347f1cac5103b0050cc1be6a1496c8', 'df30427c488aeab84b2352bdf88a3b19223f9d7a', '1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject='[test:src-git] 4 new commits to Git')).first() assert n assert n.text.startswith('\n## Branch: master'), n.text assert n.text.endswith('And 1 more commits.\n'), n.text
def test_notification_email_max_commits(self): send_notifications(self.repo, ['9a7df788cf800241e3bb5a849c8870f2f8259d98', '6a45885ae7347f1cac5103b0050cc1be6a1496c8', 'df30427c488aeab84b2352bdf88a3b19223f9d7a', '1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject=u'[test:src-git] 4 new commits to Git')).first() assert n assert n.text.startswith('\n## Branch: master'), n.text assert n.text.endswith('And 1 more commits.\n'), n.text
def test_notification_email(self): send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() notifications = M.Notification.query.find().sort('pubdate') n = notifications.all()[2] assert_equal(n.subject, '[test:src-git] [1e146e] - Rick Copeland: Change README') assert 'master,zz: ' in n.text send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a']) ThreadLocalORMSession.flush_all() notifications = M.Notification.query.find().sort('pubdate') n = notifications.all()[3] assert_equal(n.subject, '[test:src-git] 2 new commits to test Git')
def test_notification_email(self): send_notifications( self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find({'subject': u'[test:src-git] New commit by Rick Copeland'}).first() assert n assert_in('Change README', n.text) send_notifications( self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a']) ThreadLocalORMSession.flush_all() assert M.Notification.query.find( dict(subject=u'[test:src-git] 2 new commits to Git')).first()
def test_notification_email(self): send_notifications( self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find({'subject': u'[test:src-git] New commit by Rick Copeland'}).first() assert n assert_in('Change README', n.text) send_notifications( self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a']) ThreadLocalORMSession.flush_all() assert M.Notification.query.find( dict(subject=u'[test:src-git] 2 new commits to Git')).first()
def test_notification_email(self): setup_global_objects() h.set_context('test', 'src', neighborhood='Projects') repo_dir = pkg_resources.resource_filename('forgesvn', 'tests/data/') self.repo = SM.Repository(name='testsvn', fs_path=repo_dir, url_path='/test/', tool='svn', status='creating') self.repo.refresh() ThreadLocalORMSession.flush_all() send_notifications(self.repo, [self.repo.rev_to_commit_id(1)]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject='[test:src] [r1] - rick446: Create readme')).first() assert n assert_equal(n.text, 'Create readme http://localhost/p/test/src/1/')
def test_notification_email(self): setup_global_objects() h.set_context('test', 'src', neighborhood='Projects') repo_dir = pkg_resources.resource_filename( 'forgesvn', 'tests/data/') self.repo = SM.Repository( name='testsvn', fs_path=repo_dir, url_path = '/test/', tool = 'svn', status = 'creating') self.repo.refresh() ThreadLocalORMSession.flush_all() send_notifications(self.repo, [self.repo.rev_to_commit_id(1)]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict(subject='[test:src] [r1] - rick446: Create readme')).first() assert n assert_equal(n.text, 'Create readme http://localhost/p/test/src/1/')
def test_notification_email(self): send_notifications(self.repo, [ '1e146e67985dcd71c74de79613719bef7bddca4a', ]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find( dict( subject='[test:src-git] [1e146e] - Rick Copeland: Change README' )).first() assert n assert 'master: ' in n.text, n.text send_notifications(self.repo, [ '1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a' ]) ThreadLocalORMSession.flush_all() assert M.Notification.query.find( dict(subject='[test:src-git] 2 new commits to Test Project Git') ).first()
def test_notification_email(self): setup_global_objects() h.set_context('test', 'src', neighborhood='Projects') repo_dir = pkg_resources.resource_filename( 'forgesvn', 'tests/data/') self.repo = SM.Repository( name='testsvn', fs_path=repo_dir, url_path='/test/', tool='svn', status='creating') self.repo.refresh() ThreadLocalORMSession.flush_all() send_notifications(self.repo, [self.repo.rev_to_commit_id(1)]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find({u'subject': u'[test:src] New commit by rick446'}).first() assert n assert_in(u'By rick446', n.text) assert_in(u'Create readme', n.text)
def test_notification_email(self): setup_global_objects() h.set_context('test', 'src', neighborhood='Projects') repo_dir = pkg_resources.resource_filename('forgesvn', 'tests/data/') self.repo = SM.Repository(name='testsvn', fs_path=repo_dir, url_path='/test/', tool='svn', status='creating') self.repo.refresh() ThreadLocalORMSession.flush_all() send_notifications(self.repo, [self.repo.rev_to_commit_id(1)]) ThreadLocalORMSession.flush_all() n = M.Notification.query.find({ u'subject': u'[test:src] New commit by rick446' }).first() assert n assert_in(u'By rick446', n.text) assert_in(u'Create readme', n.text)