DEV Community

Cover image for A View From Start To Finish - Building SaaS #60
Matt Layman
Matt Layman

Posted on • Originally published at mattlayman.com

2

A View From Start To Finish - Building SaaS #60

In this episode, I created a view to add students from beginning to the end. I used Error Driven Development to guide what I needed to do next to make the view, then wrote tests, and finished it all off by writing the template code.

At the start of the episode, I gave a quick overview of the models in my application and which models I planned to focus on for the stream.

We worked on a view to add students. I did this using a technique that I called Error Driven Development. With this strategy, I started with what I wanted and followed the error messages to drive to what I needed to write. Django's error messages are good enough to show what was needed for each step.

After creating a view that didn't error anymore, I filled in some tests to prove that the view behaved in the way I wanted.

Finally, I wrote the template that provides the proper data for the newly created view.

Once the template was complete, I did one manual end-to-end test to confirm that the template and view worked together. I verified in the Django admin that the view created a new student.

This article first appeared on mattlayman.com.

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay