Example #1
0
    def test_get_sha256_pw(self):
        """Test get_sha256_pw"""

        security = Security(self.settings, self.request.session, 'jdoe',
                            '*****@*****.**', 'iamjohndoe', 'iamjohndoe')

        assert len(security.get_sha256_pw(
        )) == 64  # We cant predict the string cause there is random for salt
Example #2
0
    def test_update_passwd(self):
        """Test update_mail"""

        self.tps.clean_up()
        self.tps.add_jdoe_in_users()

        security = Security(self.settings, self.request.session, 'jdoe', '*****@*****.**', 'newpasswd', 'newpasswd')

        security.update_passwd()

        graph = 'urn:sparql:test_askomics:users'
        triple = ':jdoe :password "' + security.get_sha256_pw() + '"'
        assert self.tps.test_triple_presence(graph, triple)
        triple = ':jdoe :password "23df582b51c3482b677c8eac54872b8bd0a49bfadc853628b8b8bd4806147b54"'
        assert not self.tps.test_triple_presence(graph, triple)
Example #3
0
    def test_update_passwd(self):
        """Test update_mail"""

        self.tps.clean_up()
        self.tps.add_jdoe_in_users()

        security = Security(self.settings, self.request.session, 'jdoe',
                            '*****@*****.**', 'newpasswd', 'newpasswd')

        security.update_passwd()

        graph = 'urn:sparql:test_askomics:users'
        triple = ':jdoe :password "' + security.get_sha256_pw() + '"'
        assert self.tps.test_triple_presence(graph, triple)
        triple = ':jdoe :password "23df582b51c3482b677c8eac54872b8bd0a49bfadc853628b8b8bd4806147b54"'
        assert not self.tps.test_triple_presence(graph, triple)
Example #4
0
    def test_update_passwd(self):
        """Test update_mail"""

        self.tps.clean_up()
        self.tps.add_jdoe_in_users()

        security = Security(self.settings, self.request.session, 'jdoe',
                            '*****@*****.**', 'newpasswd', 'newpasswd')

        security.update_passwd()

        assert self.tps.test_row_presence('users', 'password',
                                          (security.get_sha256_pw(), ))
        assert not self.tps.test_row_presence('users', 'password', (
            '23df582b51c3482b677c8eac54872b8bd0a49bfadc853628b8b8bd4806147b54',
        ))
Example #5
0
    def test_get_sha256_pw(self):
        """Test get_sha256_pw"""

        security = Security(self.settings, self.request.session, 'jdoe', '*****@*****.**', 'iamjohndoe', 'iamjohndoe')

        assert len(security.get_sha256_pw()) == 64 # We cant predict the string cause there is random for salt