--
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...@googlegroups.com.
To post to this group, send email to django...@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.
Hi,
one possibility is this:
class UserTest(TestCase):In some cases this will work, but it might also not work (e.g. if you want to organize tests differently). I've found Two Scoops' advice invaluable on this issue: 1) Never use fixtures, 2) DRY does not apply to tests. It's fine to repeat the same code again and again when testing.
def setUp(self):
self.my_data = {...}
def test_create_account(self):
response = self.client.post('/signup/', json.dumps(self.my_data), content_type='application/json')
self.assertIs(...)
def test_login(self):
...
Antonis Christofides http://djangodeployment.com
class SignUpTest(TestCase):def test_createAccount(self):my_data = {'username': 'akash.tomar107', 'password': 'akashtomar',"email":"akash.toma...@gmail.com", "confirm_password":"akashtomar", "type_of_user":"1", "first_name":"akash", "last_name":"tomar"}