Hey man...great content. Good explanations given by you. But I had a doubt. You were creating some objects of different models in the tests. Are these objects also created in our database or they are just for testing only?
hey man, in post expenses you added the body to client.post(url, {content}) but you have not create an object from it. so how the expense was created? and how it was added to the project! why did it work without creating object and add it to db with relation to project1
I've got this error: postgres' database and will use the first PostgreSQL database instead. warnings.warn( Got an error creating the test database: permission denied to create database I dont know how to fix... :\. Django 3
I thought this would come in handy, however you dont really explain what is happening, what each part does etc. This is just a video of someone writing code and narrating what he writes but without any explanation. Its great if the person wants to copy/paste and not understand, but for the long term thinkers, no explanation mean no understanding. Thumbs down
you should have some background first, i`d advice you to read the official DJ tutorial for begginers, there is testing part and everything is clear for begginers
I was struggling with testing my django apps but this playlist really helped me out. Thank you!💯
Thank you very much for this great video series ! I just started with django tests and this is a great help. Thanks again :)
very nice QOL changes, me and my group working on our project using this hehe
Thanks for the tutorial, It's very helpful for a beginner.
It worked for me perfectly. Thank you.
best tutorial ever!
Thanks, man! This was really helpful.
Thank u so much, helped
Thanks man!!! Keep up the good work
Thx a lot, great like always!
You're welcome!
Hey man...great content. Good explanations given by you. But I had a doubt. You were creating some objects of different models in the tests. Are these objects also created in our database or they are just for testing only?
When you run tests django creates or re-creates test database wich is set in settings.py, though your real db won't be affected
@@ilyasjumadurdyew8074 Great answer!
Really nice!
@The Dumbfounds Please link the exact github project path to the code you are using in the tutorial
where did that "expenses" come from in "self.assertEquals(self.project1.expenses.first().title, 'expense1')"
Hello i wonder why pycharm throw me “ reverse for ‘list’ not found
hey man,
in post expenses you added the body to client.post(url, {content})
but you have not create an object from it.
so how the expense was created?
and how it was added to the project!
why did it work without creating object and add it to db with relation to project1
whats your urls file?
I've got this error:
postgres' database and will use the first PostgreSQL database instead.
warnings.warn(
Got an error creating the test database: permission denied to create database
I dont know how to fix... :\. Django 3
for testing just switch to dbsqlite database and try.. it worked for me
@@sagarpotnis1215 yes we’ve done this approach. Thank you.
200 = mean first check at code 200 and if i have article and i want test 1000 . just replace 200 by 1000 ?
Sorry, could you rephrase the question?
@@thedumbfounds767 I want to make test for users in database and if database can contain more than 10000 user or not ?
@@MahmoudGamal-xe9rv Well, by default, it should be able to contain 10.000 users and many more :)
@@thedumbfounds767 good my question is 200 any relation by default number of users
@@MahmoudGamal-xe9rv 200 is the status code of the response. It means that everything was okay.
Tutorials on testing are hard to come by
I thought this would come in handy, however you dont really explain what is happening, what each part does etc. This is just a video of someone writing code and narrating what he writes but without any explanation. Its great if the person wants to copy/paste and not understand, but for the long term thinkers, no explanation mean no understanding. Thumbs down
you should have some background first, i`d advice you to read the official DJ tutorial for begginers, there is testing part and everything is clear for begginers
It's pretty clear if you have some experience with Django and unit testing. It's not meant for beginners so you can skip this one.
I am doing it the exact same way and I am getting:
AssertionError: 302 != 200
Try adding the following:
def setUp(self):
self.client = Client()
self.user = User.objects.create_superuser('test_admin', '', 'test_admin')
self.client.login(username='test_admin', password='test_admin')
have you got the solution i am getting the same error
dude this extra function is so dull, why just why.... totally ruined the progress for me, why would anybody wanna do such nonsense....