#29 refactor(Tests): extract to mixin class.
This commit is contained in:
10
tienda_ilusion/don_confiao/tests/Mixins.py
Normal file
10
tienda_ilusion/don_confiao/tests/Mixins.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class LoginMixin:
|
||||
def login(self):
|
||||
username = 'nombre_usuario'
|
||||
password = 'contraseña'
|
||||
email = 'correo@example.com'
|
||||
self.user = User.objects.create_user(username, email, password)
|
||||
self.client.login(username=username, password=password)
|
||||
Reference in New Issue
Block a user