allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [34/50] git commit: [#4504] ticket:311 Test for $USER variable in ticket searches
Date Tue, 16 Apr 2013 12:29:24 GMT
[#4504] ticket:311 Test for $USER variable in ticket searches


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6f045479
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6f045479
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6f045479

Branch: refs/heads/acs2/5518
Commit: 6f045479527c2444193c43d1d7d6e583402413ee
Parents: c794904
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Apr 9 09:02:12 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Fri Apr 12 17:07:49 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/tests/functional/test_root.py     |   21 +++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6f045479/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index ed03410..cef0134 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -816,6 +816,27 @@ class TestFunctionalController(TrackerTestController):
         response = self.app.get('/p/test/bugs/search_feed.atom?q=test')
         assert '<title>test first ticket</title>' in response
 
+    def test_search_current_user(self):
+        self.new_ticket(summary='test first ticket')
+        self.new_ticket(summary='test second ticket')
+        p = M.Project.query.get(shortname='test')
+        tracker = p.app_instance('bugs')
+        t = tm.Ticket.query.get(summary='test first ticket')
+        t.reported_by_id = M.User.by_username('test-user-0')._id
+        t = tm.Ticket.query.get(summary='test second ticket')
+        t.reported_by_id = M.User.by_username('test-user-1')._id
+        ThreadLocalORMSession.flush_all()
+        M.MonQTask.run_ready()
+        ThreadLocalORMSession.flush_all()
+        response = self.app.get('/p/test/bugs/search/?q=reported_by_s:$USER',
+                                extra_environ={'username': 'test-user-0'})
+        assert '1 result' in response, response.showbrowser()
+        assert 'test first ticket' in response, response.showbrowser()
+        response = self.app.get('/p/test/bugs/search/?q=reported_by_s:$USER',
+                                extra_environ={'username': 'test-user-1'})
+        assert '1 result' in response, response.showbrowser()
+        assert 'test second ticket' in response, response.showbrowser()
+
     def test_feed(self):
         self.new_ticket(
             summary='test first ticket',


Mime
View raw message