Fix test
This commit is contained in:
parent
2a6993cad8
commit
c3274b4a65
|
|
@ -8,6 +8,7 @@ from portfolio.inputs import AddProjectArgument, AddProjectEntryArgument, Update
|
|||
from portfolio.models import Project, ProjectEntry
|
||||
from portfolio.schema import ProjectEntryNode, ProjectNode
|
||||
from portfolio.serializers import ProjectEntrySerializer, ProjectSerializer
|
||||
from users.models import UserSetting
|
||||
|
||||
|
||||
def check_owner(user, project):
|
||||
|
|
@ -40,6 +41,7 @@ class AddProject(MutateProject):
|
|||
def mutate_and_get_payload(cls, root, info, **kwargs):
|
||||
data = kwargs.get('project')
|
||||
data['student'] = info.context.user.id
|
||||
data['school_class'] = info.context.user.selected_class.id
|
||||
|
||||
serializer = ProjectSerializer(data=data)
|
||||
if serializer.is_valid():
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class NewRoomMutationTestCase(SkillboxTestCase):
|
|||
def test_create_new_room(self):
|
||||
self.assertEqual(Room.objects.count(), 0)
|
||||
title = 'some title'
|
||||
appearance='blue'
|
||||
appearance = 'blue'
|
||||
res = self.get_client().execute(self.mutation, variables={
|
||||
'input': {
|
||||
'room': {
|
||||
|
|
@ -87,7 +87,9 @@ class NewRoomMutationTestCase(SkillboxTestCase):
|
|||
}
|
||||
}
|
||||
})
|
||||
self.assertIsNotNone(result.errors)
|
||||
self.assertTrue('Permission' in result.errors)
|
||||
self.assertEqual(Room.objects.count(), 0)
|
||||
|
||||
self.assertEqual(Room.objects.count(), 1)
|
||||
|
||||
room = Room.objects.all()[0]
|
||||
self.assertEqual(room.school_class.id, self.teacher2.selected_class.id)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue