Exemplo n.º 1
0
 def create_user_teacher(self):
     username = '******'
     password = '******'
     register_new_teacher(username, password)
     data = {'username': username,
             'password': password, }
     return data
Exemplo n.º 2
0
 def create_user_trainee_coordinator(self):
     username = '******'
     password = '******'
     register_new_teacher(username, password)
     user = User.objects.all()[0]
     user.is_trainee_coordinator = True
     user.save()
     data = {'username': username,
             'password': password, }
     return data
Exemplo n.º 3
0
 def setUp(self):
     data = self.create_user_admin()
     self.resp = self.client.post(r('core:login'), data)
     self.resp = self.client.post(r(view_in_test))
     register_new_teacher('*****@*****.**', '123mudar')
     User = get_user_model()
     self.id = User.objects.get(email='*****@*****.**').pk
     data = {}
     data['user_id'] = self.id
     data['password'] = ''
     self.resp = self.client.post(r(view_in_test), data, follow=True)
Exemplo n.º 4
0
 def setUp(self):
     data = self.create_user_admin()
     self.resp = self.client.post(r('core:login'), data)
     self.resp = self.client.post(r(view_in_test))
     register_new_teacher('*****@*****.**', '123mudar')
     User = get_user_model()
     self.id = User.objects.get(email='*****@*****.**').pk
     update_user(self.id, '1234mudar', 'José', 'Silva')
     data = {}
     data['user_id'] = self.id
     data['password'] = '******'
     data['first_name'] = 'John'
     data['last_name'] = 'Doe'
     self.resp = self.client.post(r(view_in_test), data, follow=True)
Exemplo n.º 5
0
def cadastro_professor(request):
    if request.method == 'GET':
        context = {'form': UserCreateForm()}
        return render(request, 'cadastro_professor.html', context)
    else:
        form = UserCreateForm(request.POST)
        if form.is_valid():
            email = form.cleaned_data.get('email', '')
            password = form.cleaned_data.get('password', '')
            register_new_teacher(email, password)
        else:
            context = {'form': form}
            return render(request, 'cadastro_professor.html', context)
        context = {
            'title': 'Cadastrar Professores na plataforma FATEC',
            'msg': 'Cadastro de docente realizado com sucesso !',
        }
        return render(request, 'cadastro_edicao_concluido.html', context)
Exemplo n.º 6
0
 def setUp(self):
     register_new_teacher('*****@*****.**', '123mudar')
     self.form = self.make_validated_form()
     self.validated = self.form.is_valid()
     self.form.save()
Exemplo n.º 7
0
 def setUp(self):
     self.username = '******'
     self.password = '******'
     User = get_user_model()
     register_new_teacher(self.username, self.password)
     self.user = User.objects.get(email=self.username)
Exemplo n.º 8
0
 def setUp(self):
     self.password = '******'
     self.student = register_new_student('*****@*****.**', self.password)
     self.teacher = register_new_teacher('*****@*****.**', self.password)
     self.company = register_new_company('*****@*****.**', self.password)
     self.admin = register_new_admin('*****@*****.**', self.password)
Exemplo n.º 9
0
 def setUp(self):
     self.username = '******'
     self.student = register_new_student(self.username, None)
     self.teacher = register_new_teacher(self.username, None)
     self.company = register_new_company(self.username, None)
     self.admin = register_new_admin(self.username, None)