The promotions resource allows marketing managers to create, read, update, delete, search, and list promotions. At a minimum a promoution should contain a name, a start date, an end date, and whether or not the promotion is active.
This lab uses Docker and Visual Studio Code with the Remote Containers extension to provide a consistent repeatable disposable development environment for all of the labs in this course.
You will need the following software installed:
Remote Containers extension from the Visual Studio Marketplace
All of these can be installed manually by clicking on the links above or you can use a package manager like Homebrew on Mac of Chocolatey on Windows.
Alternately, you can use Vagrant and VirtualBox to create a consistent development environment in a virtual machine (VM).
You can read more about creating these environments in John Rofrano's article: Creating Reproducable Development Environments
$ git clone https://github.com/PromotionsSquad/promotions.git
$ cd promotions
$ code .
Note that there is a period .
after the code
command. This tells Visual Studio Code to open the editor and load the current folder of files.
$ git pull
As developers we always want to run the tests before we change any code. That way we know if we broke the code or if someone before us did. Always run the test cases first!
nosetests
$ nosetests
$ honcho start
You should be able to reach the service at: http://localhost:8080. The port that is used is controlled by an environment variable defined in the .flaskenv file which Flask uses to load it's configuration from the environment by default.
Once in the environment try various actions such as:
$ behave