Revision fcdd2549 snf-cyclades-app/synnefo/ui/userdata/tests.py

b/snf-cyclades-app/synnefo/ui/userdata/tests.py
54 54
    fixtures = ['users']
55 55

  
56 56
    def setUp(self):
57
        def get_user_mock(request, *Args, **kwargs):
58
            if request.META.get('HTTP_X_AUTH_TOKEN', None) == '0000':
59
                request.user_uniq = 'test'
60
                request.user = {'uniq': 'test'}
61

  
62
        # mock the astakos authentication function
63
        from synnefo.lib import astakos
64
        astakos.get_user = get_user_mock
65

  
57 66
        settings.SKIP_SSH_VALIDATION = True
58 67
        self.client = AaiClient()
59 68
        self.user = 'test'

Also available in: Unified diff