~jose/charms/precise/juju-gui/add-blank-defaults

« back to all changes in this revision

Viewing changes to server/guiserver/tests/test_auth.py

  • Committer: Francesco Banconi
  • Date: 2014-01-22 09:09:01 UTC
  • mfrom: (60.13.77 juju-gui-trunk)
  • Revision ID: francesco.banconi@canonical.com-20140122090901-o89b944jb13kk1o9
New charm release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
        self.assert_user('', '', False)
205
205
 
206
206
 
207
 
class TestPythonAuthMiddleware(
208
 
        helpers.PythonAPITestMixin, AuthMiddlewareTestMixin,
209
 
        LogTrapTestCase, unittest.TestCase):
210
 
    pass
211
 
 
212
 
 
213
207
class BackendTestMixin(object):
214
208
    """Include tests for the authentication backends.
215
209
 
288
282
            self.assertFalse(is_login, request)
289
283
 
290
284
 
291
 
class TestPythonBackend(
292
 
        helpers.PythonAPITestMixin, BackendTestMixin, unittest.TestCase):
293
 
 
294
 
    def test_request_is_not_login(self):
295
 
        # False is returned if the passed data is not a login request.
296
 
        requests = (
297
 
            {},
298
 
            {
299
 
                'request_id': 42,
300
 
                'op': 'INVALID',
301
 
                'user': 'user',
302
 
                'password': 'passwd',
303
 
            },
304
 
            {
305
 
                'request_id': 42,
306
 
                'op': 'login',
307
 
                'password': 'passwd',
308
 
            },
309
 
            {
310
 
                'request_id': 42,
311
 
                'op': 'login',
312
 
                'user': 'user',
313
 
            },
314
 
        )
315
 
        for request in requests:
316
 
            is_login = self.backend.request_is_login(request)
317
 
            self.assertFalse(is_login, request)
318
 
 
319
 
 
320
285
class TestAuthenticationTokenHandler(LogTrapTestCase, unittest.TestCase):
321
286
 
322
287
    def setUp(self):