~fabricematrat/charmworld/redirect-charm

« back to all changes in this revision

Viewing changes to charmworld/views/tests/test_charms.py

  • Committer: Fabrice Matrat
  • Date: 2015-02-09 13:24:41 UTC
  • Revision ID: fabricematrat@gmail.com-20150209132441-61p0ec7wr11a83rv
Added assert in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
168
168
    def test_personal_collection(self):
169
169
        request = self.getRequest()
170
170
        request.matchdict = {'owner': 'foo'}
171
 
        with self.assertRaises(HTTPMovedPermanently):
 
171
        with self.assertRaises(HTTPMovedPermanently) as e:
172
172
            personal_collection(request)
 
173
        self.assertIn('/q/foo', e.exception.location)
173
174
 
174
175
    def test_series_collection(self):
175
176
        request = self.getRequest()
176
177
        request.matchdict = {'series': 'one'}
177
 
        with self.assertRaises(HTTPMovedPermanently):
 
178
        with self.assertRaises(HTTPMovedPermanently) as e:
178
179
            series_collection(request)
 
180
        self.assertIn('/q/one', e.exception.location)
179
181
 
180
182
    def test_personal_series_collection(self):
181
183
        request = self.getRequest()
182
184
        request.matchdict = {'series': 'one', 'owner': 'me'}
183
 
        with self.assertRaises(HTTPMovedPermanently):
 
185
        with self.assertRaises(HTTPMovedPermanently) as e:
184
186
            personal_series_collection(request)
 
187
        self.assertIn('/q/me/one', e.exception.location)
185
188
 
186
189
    def test_interface(self):
187
190
        # interface() returns all charms requiring or providing a given