class SignUpTest(TestCase):
def test_createAccount(self):
my_data = {'username': 'akash.tomar107', 'password': 
'akashtomar',"email":"akash.tomar...@gmail.com", 
"confirm_password":"akashtomar", "type_of_user":"1", "first_name":"akash", 
"last_name":"tomar"}
response = self.client.post('/signup/', json.dumps(my_data), 
content_type='application/json')
self.assertIs(json.loads(response.content)["success"], True)

class LoginTest(TestCase):
def test_login(self):
my_data = {'username': 'akash.tomar107', 'password': 'akashtomar'}
response = self.client.post('/login/', json.dumps(my_data), 
content_type='application/json')
# import pdb; pdb.set_trace()
self.assertIs(json.loads(response.content)["login"], True)


I want to be able to use the data created while running SignUpTest in the 
LoginTest. How do I achieve that? Please help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a3625070-4f46-4c68-b912-888b91e42c82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to