incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [01/40] git commit: [#4429] ticket:458 improved mass edit tests
Date Thu, 31 Oct 2013 21:57:12 GMT
Updated Branches:
  refs/heads/cj/6714 26917018b -> f8d180451 (forced update)


[#4429] ticket:458 improved mass edit tests


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

Branch: refs/heads/cj/6714
Commit: 8221856938fc0e874a7d5ec461d10e5438f2b50e
Parents: 25ab74e
Author: coldmind <sokandpal@yandex.ru>
Authored: Wed Oct 23 19:27:47 2013 +0300
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Oct 24 16:59:23 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/tests/functional/test_root.py  | 52 ++++++++++++++++----
 1 file changed, 42 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/82218569/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 b31d755..6fb5d43 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -333,6 +333,7 @@ class TestFunctionalController(TrackerTestController):
         r = self.app.get('/p/test/bugs/2/')
         assert '<li><strong>Status</strong>: open --&gt; accepted</li>'
in r
 
+    def test_mass_edit_custom_fields(self):
         params = dict(
             custom_fields=[
                 dict(name='_major', label='Major', type='boolean'), ],
@@ -346,38 +347,69 @@ class TestFunctionalController(TrackerTestController):
         self.new_ticket(summary='First Custom', **kw)
         kw = {'custom_fields._major': ''}
         self.new_ticket(summary='Second Custom', **kw)
-        third_ticket = tm.Ticket.query.find({
+        M.MonQTask.run_ready()
+
+        ticket1 = tm.Ticket.query.find({
             'summary': 'First Custom'}).first()
-        fourth_ticket = tm.Ticket.query.find({
+        ticket2 = tm.Ticket.query.find({
             'summary': 'Second Custom'}).first()
 
         self.app.post('/p/test/bugs/update_tickets', {
                       '__search': '',
                       '__ticket_ids': (
-                          third_ticket._id,
-                          fourth_ticket._id,),
+                          ticket1._id,
+                          ticket2._id,),
                       'status': 'accepted',
                       '_major': 'False'
                       })
         M.MonQTask.run_ready()
-        r = self.app.get('/p/test/bugs/3/')
+        r = self.app.get('/p/test/bugs/1/')
         assert '<li><strong>Major</strong>: True --&gt; False</li>'
in r
-        r = self.app.get('/p/test/bugs/4/')
+        r = self.app.get('/p/test/bugs/2/')
         assert '<li><strong>Major</strong>: True --&gt; False</li>'
not in r
+        ticket1 = tm.Ticket.query.find({
+            'summary': 'First Custom'}).first()
+        ticket2 = tm.Ticket.query.find({
+            'summary': 'Second Custom'}).first()
+        assert_equal(ticket1.custom_fields._major, u'False')
+        assert_equal(ticket2.custom_fields._major, u'False')
 
         self.app.post('/p/test/bugs/update_tickets', {
                       '__search': '',
                       '__ticket_ids': (
-                          third_ticket._id,
-                          fourth_ticket._id,),
+                          ticket1._id,
+                          ticket2._id,),
                       'status': 'accepted',
                       '_major': 'True'
                       })
         M.MonQTask.run_ready()
-        r = self.app.get('/p/test/bugs/3/')
+        r = self.app.get('/p/test/bugs/1/')
         assert '<li><strong>Major</strong>: False --&gt; True</li>'
in r
-        r = self.app.get('/p/test/bugs/4/')
+        r = self.app.get('/p/test/bugs/2/')
         assert '<li><strong>Major</strong>: False --&gt; True</li>'
in r
+        ticket1 = tm.Ticket.query.find({
+            'summary': 'First Custom'}).first()
+        ticket2 = tm.Ticket.query.find({
+            'summary': 'Second Custom'}).first()
+        assert_equal(ticket1.custom_fields._major, u'True')
+        assert_equal(ticket2.custom_fields._major, u'True')
+
+        self.app.post('/p/test/bugs/update_tickets', {
+                      '__search': '',
+                      '__ticket_ids': (
+                          ticket1._id,
+                          ticket2._id,),
+                      'status': 'accepted',
+                      '_major': ''
+                      })
+        M.MonQTask.run_ready()
+        ticket1 = tm.Ticket.query.find({
+            'summary': 'First Custom'}).first()
+        ticket2 = tm.Ticket.query.find({
+            'summary': 'Second Custom'}).first()
+        assert_equal(ticket1.custom_fields._major, u'True')
+        assert_equal(ticket2.custom_fields._major, u'True')
+
 
     def test_private_ticket(self):
         ticket_view = self.new_ticket(summary='Public Ticket').follow()


Mime
View raw message