def testa_put_agenda_realizada(self): request = self.factory.put( reverse('rud_agenda_realizada', kwargs={'pk': self.agenda_realizada.pk})) request.user = self.aluno request.parser_context = {'kwargs': {'pk': self.agenda_realizada.pk}} self.assertTrue(Permissoes().has_permission(request, rud))
def testa_get_agendas_nao_realizadas_aluno(self): request = self.factory.get( reverse('get_agendas_nao_realizadas_aluno', kwargs={'pk': self.aluno.pk})) request.user = self.aluno request.parser_context = {'kwargs': {'pk': self.aluno.pk}} self.assertTrue(Permissoes().has_permission(request, get))
def testa_get_grupo(self): request = self.factory.get( reverse('rud_grupo', kwargs={'pk': self.grupo.pk})) request.user = self.aluno request.parser_context = { 'kwargs': { 'pk': self.grupo.pk, 'username': self.aluno.username } } self.assertTrue(Permissoes().has_permission(request, get))
def testa_post_agenda_realizada(self): content = { 'texto': 'Agenda realizada', 'agenda': self.agenda.id, 'aluno': self.aluno.id, } request = self.factory.post(reverse('post_agenda_realizada'), content, content_type='application/json') request.user = self.admin self.assertTrue(Permissoes().has_permission(request, post))
def testa_post_aluno(self): content = { 'username': '******', 'first_name': 'Nome', 'last_name': 'Sobrenome', 'password': '******', 'grupo': None, 'formulario': None, } request = self.factory.post(reverse('post_aluno'), content, content_type='application/json') request.user = AnonymousUser() self.assertTrue(Permissoes().has_permission(request, post))
def testa_get_material(self): request = self.factory.get( reverse('rud_material', kwargs={'pk': self.material.pk})) request.user = self.admin self.assertTrue(Permissoes().has_permission(request, get))
def testa_get_materiais(self): request = self.factory.get(reverse('get_materiais')) request.user = self.admin self.assertTrue(Permissoes().has_permission(request, get))