def setUp(self):
        setup_test_dir()
        server.reset_userdata()

        self.app = server.app.test_client()
        self.app.testing = True

        self.username = USR
        self.password = PW
        self.user_dirpath = userpath2serverpath(self.username)
Пример #2
0
    def setUp(self):
        setup_test_dir()
        server.reset_userdata()
        self.app = server.app.test_client()
        self.app.testing = True

        self.active_user = '******'
        self.active_user_pw = pick_rand_pw(8)
        _manually_create_user(self.active_user, self.active_user_pw)
        self.pending_user = '******'
        server.pending_users[self.pending_user] = {'timestamp': server.now_timestamp(),
                                                   'activation_code': 'fake-activation-code'}
    def setUp(self):
        setup_test_dir()
        server.reset_userdata()

        self.app = server.app.test_client()
        self.app.testing = True
        self.username = USR
        self.password = PW
        self.user_dirpath = userpath2serverpath(self.username)
        assert self.username not in server.userdata
        assert not os.path.exists(self.user_dirpath)

        # The Users.post (signup request) is repeatable
        resp = self.app.post(urlparse.urljoin(SERVER_API, 'users/' + self.username),
                             data={'password': self.password})

        # Retrieve the generated activation code
        self.activation_code = server.userdata[self.username][server.USER_CREATION_DATA]['activation_code']
    def setUp(self):
        setup_test_dir()
        server.reset_userdata()
        self.app = server.app.test_client()
        self.app.testing = True

        self.active_user = '******'
        self.active_user_pw = '234.Cde'
        _manually_create_user(self.active_user, self.active_user_pw)

        self.inactive_username = '******'
        self.inactive_username_password = '******'
        self.inactive_username_activationcode = 'randomactivationcode'
        server.userdata[self.inactive_username] = {
            server.USER_IS_ACTIVE: False,
            server.PWD: self.inactive_username_password,
            server.USER_CREATION_DATA: {'creation_timestamp': server.now_timestamp(),
                                        'activation_code':  self.inactive_username_activationcode,
                                       },
            }
 def setUp(self):
     setup_test_dir()
     server.reset_userdata()
     self.app = server.app.test_client()
     self.app.testing = True