Today I Learned - HTTP Codes, PyTest and Testing HTTP Post Requests using Django

Today I Learned - HTTP Codes, PyTest and Testing HTTP Post Requests using Django

Hey so! I don't normally write today I learned - okay, lies - I always write it on LinkedIn and I sometimes used to write it on Susanna Codes too.

But I tried really hard with this one and I feel I learned a lot so here goes.

I am supposed to be doing a Regex course but my brain is struggling at this time today.

I also have a homework to do on decorators but that is for another time... 💖🩷💗💖🩷💜

Today I Learned

Today I had so many adventures and learned so many many exciting new things.

I can't even begin to list them all! I really enjoyed writing a status code response - it was so interesting to use a `201` status code (Created) and not just a generic `200` - it was so interesting how I was told that we could get something more specific than just a 200 - the exact words were 'something that is more informative'.

Again I feel so fortunate and so so privileged to be learning from such amazing developers every day.

I had a really amazing time writing loads of tests as well. I looked at Django testing for HTTP requests (I LOOOOOOOOOVE HTTP requests, did you know? Did I ever say this before?), and I wrote the test for the happy path for a POST request. I then wrote two tests for two of the unhappy paths too.

I LOVE writing tests for unhappy paths.

There is so much creativity involved. People may think that software development is not a creative job.

In actual fact it is the most creative profession in the world. Every name, every variable name, every test that needs to be written, is so unique and so creative.

P.S. I raised another PR today! So that is another dream come true.

Every day is a dream come true.

Every PR is a dream come true.

Every ticket that I get to work is a dream come true.

Every amazing colleague that I have been sent to help me is a dream come true, thank you. Every pairing session is a dream come true.

Life is a long big amazing beautiful miracle and every moment of it is a dream come true.

I am so grateful and happy to have raised this PR 😍! thank you.

A futuristic and spacelike image with lots of texts.   Circle in the centre reads: today I learned. Six circles around it read: "testing for post requests in django", "raised another pr - raising prs is becoming more natural", "using pytest", "status code 201 created", "django http tests", "writing tests for unhappy paths."

Comments

Popular Posts