~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/tests/test_translationimportqueue.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-27 19:27:56 UTC
  • mfrom: (13453.4.5 bug-800123)
  • Revision ID: launchpad@pqm.canonical.com-20110727192756-twhbrx0a7mnie8qw
[r=gmb][bug=800123] Allow project maintainers and owners to manage
        and approve translation imports themselves.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
        # The owner (maintainer) of the product gets to set Blocked as well.
102
102
        owner = self.productseries.product.owner
103
103
        self._assertCanSetStatus(owner, self.entry,
104
 
            #  A      B     D     F      I     NI     NR
105
 
            [False, True, True, False, False, False, True])
 
104
            #  A     B     D     F      I     NI    NR
 
105
            [True, True, True, False, False, True, True])
106
106
 
107
107
    def test_canSetStatus_owner_and_uploader(self):
108
108
        # Corner case: Nothing changes if the maintainer is also the uploader.
109
109
        self.productseries.product.owner = self.uploaderperson
110
110
        self._assertCanSetStatus(self.uploaderperson, self.entry,
111
 
            #  A      B     D     F      I     NI     NR
112
 
            [False, True, True, False, False, False, True])
 
111
            #  A     B     D     F      I     NI    NR
 
112
            [True, True, True, False, False, True, True])
113
113
 
114
114
    def test_canSetStatus_driver(self):
115
115
        # The driver gets the same permissions as the maintainer.
116
116
        driver = self.productseries.driver
117
117
        self._assertCanSetStatus(driver, self.entry,
118
 
            #  A      B     D     F      I     NI     NR
119
 
            [False, True, True, False, False, False, True])
 
118
            #  A     B     D     F      I     NI    NR
 
119
            [True, True, True, False, False, True, True])
120
120
 
121
121
    def test_canSetStatus_driver_and_uploader(self):
122
122
        # Corner case: Nothing changes if the driver is also the uploader.
123
123
        self.productseries.driver = self.uploaderperson
124
124
        self._assertCanSetStatus(self.uploaderperson, self.entry,
125
 
            #  A      B     D     F      I     NI     NR
126
 
            [False, True, True, False, False, False, True])
 
125
            #  A     B     D     F      I     NI    NR
 
126
            [True, True, True, False, False, True, True])
127
127
 
128
128
    def test_canSetStatus_product_driver(self):
129
129
        # The driver of the product, too.
130
130
        driver = self.productseries.product.driver
131
131
        self._assertCanSetStatus(driver, self.entry,
132
 
            #  A      B     D     F      I     NI     NR
133
 
            [False, True, True, False, False, False, True])
 
132
            #  A      B     D     F     I     NI    NR
 
133
            [True, True, True, False, False, True, True])
134
134
 
135
135
    def test_canSetStatus_product_driver_and_uploader(self):
136
136
        # Corner case: Nothing changes if the driver is also the uploader.
137
137
        self.productseries.product.driver = self.uploaderperson
138
138
        self._assertCanSetStatus(self.uploaderperson, self.entry,
139
 
            #  A      B     D     F      I     NI     NR
140
 
            [False, True, True, False, False, False, True])
 
139
            #  A      B     D     F     I     NI    NR
 
140
            [True, True, True, False, False, True, True])
141
141
 
142
142
    def _setUpUbuntu(self):
143
143
        self.ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
345
345
        # queue, the entry importer is not updated because that would
346
346
        # cause an non-unique key for the entry.
347
347
        with person_logged_in(self.new_owner):
348
 
            new_entry = self.import_queue.addOrUpdateEntry(
 
348
            self.import_queue.addOrUpdateEntry(
349
349
                u'po/sr.po', 'foo', True, self.new_owner,
350
350
                productseries=self.product.series[0])
351
351
        with person_logged_in(self.old_owner):