Django Testing Tutorial - Testing Models #4

preview_player
Показать описание
In this video, we will test the different methods of the expense model.

7 Tips For Getting Better At Django:

Get the starting point on GitHub:

If you enjoyed this video, make sure to subscribe and share it with anyone you think could enjoy it as well.

I hope to see you inside of the next episode,

Cheers.
Рекомендации по теме
Комментарии
Автор

I'd love if you have tests for standard models and many-to-many ones such as ForeignKey. There are
almost no video about them.

ProSimples
Автор

Great videos. Really explanatory. Waiting for the video on testing templates.

victoradukwu
Автор

it's the best test-tutorial. it's video>Russians video

about_python
Автор

Is there no video on how to do this on a windows machina?

thetruereality
Автор

Hi, it is a nice explanation, could anyone help me how to test a model field which has unique= true in test.py file

saicharan
Автор

Though I did the same as mentioned. I'm getting Ran 0 test cases. What should I do?

karthik
Автор

def test_get_absolute_url(self):
response = Project.objects.create(
name = "project 2",
budget = 1000
)
self.assertEquals(response.slug, response.name.replace(" ", "-"))

#Correct me if i am wrong..

TariqAhmed_
Автор

The code is not there on your github. The repo doesn't have the test cases.

AdityaSingh-fkvu
Автор

does anyone know why when I do this I get a Apps aren't loaded yet. Error?

mattcarter
Автор

Testing for gau is 'overboard'? Seriously?

malikrumi
Автор

i write a little bit code for absolute_url function

def test_absolute_slug(self):
expected_url = f'/{self.project1.slug}'
actual_url =
self.assertEquals(actual_url, expected_url, True)


if something went wrong write comment

xushnudbekjumayev
Автор

def test_get_absolute_url(self):
self.assertEquals(self.project1.get_absolute_url(), "/project-1")

melvinkimathi