Ejemplo n.º 1
0
 def set_password(self, raw_password):
     """Sets the user's password - always use this rather than directly
     assigning to :attr:`~mongoengine.django.auth.User.password` as the
     password is hashed before storage.
     """
     self.password = make_password(raw_password)
     self.save()
     return self
Ejemplo n.º 2
0
def test_hash():
    password = '******'
    hashed = make_password(password)
    assert hashed != password