11import typing
2+
23from apps .resources .models import ContactRequest
3- from main .tests import TestCase
44from apps .user .factories import UserFactory
5+ from main .tests import TestCase
6+
57
68class TestContactRequestMutation (TestCase ):
79 class Mutation :
@@ -31,28 +33,28 @@ class Mutation:
3133 }
3234 }
3335 """
36+
3437 @typing .override
3538 @classmethod
3639 def setUpClass (cls ):
3740 super ().setUpClass ()
3841 cls .user = UserFactory .create (email = "test@gmail.com" )
3942
40-
41- def _create_contact_request_mutation (self , data : dict [str ,str ], ** kwargs ):
43+ def _create_contact_request_mutation (self , data : dict [str , str ], ** kwargs ):
4244 return self .query_check (
4345 query = self .Mutation .CREATE_CONTACT_REQUEST ,
4446 variables = {
4547 "data" : data ,
46- }
48+ },
4749 )
50+
4851 def test_create_contact_request (self ):
4952 contact_request_data = {
50- "name" : "John" ,
51- "email" : "john@test.com" ,
52- "nationalSociety" : "Test National Society" ,
53- "content" : "This is test content" ,
54- }
55-
53+ "name" : "John" ,
54+ "email" : "john@test.com" ,
55+ "nationalSociety" : "Test National Society" ,
56+ "content" : "This is test content" ,
57+ }
5658
5759 # Without authentication
5860 content = self ._create_contact_request_mutation (contact_request_data )
@@ -76,9 +78,9 @@ def test_create_contact_request(self):
7678
7779 contact_request = ContactRequest .objects .get (pk = response_data ["result" ]["id" ])
7880 assert response_data ["result" ] == {
79- "id" : self .gID (contact_request .pk ),
80- "name" : contact_request .name ,
81- "email" : contact_request .email ,
82- "content" : contact_request .content ,
83- "nationalSociety" : contact_request .national_society ,
81+ "id" : self .gID (contact_request .pk ),
82+ "name" : contact_request .name ,
83+ "email" : contact_request .email ,
84+ "content" : contact_request .content ,
85+ "nationalSociety" : contact_request .national_society ,
8486 }
0 commit comments