Testing and Deployment
SUMMARY MAIN NOTES
When testing you test Contents
for: Testing
Unit Testing
Functionality
Django django.test
Usability SimpleTestCase
TransactionTestCase
Interface
TestCase
Compatibility Deploying Web Apps
Steps
Performance
Environment Variables
Security Set Up
Web Server Gateway Interface (WSGI)
Cron Jobs
Unit testing is Period Jobs
testing a specific Sending Emails
feature for a Internationalisation and Localisation
particular
behaviour or
assumption
Testing
You test for:
Automation allows
for tests to be Functionality: does it do what it is meant to do?
rerun after making Usability: is it easy and friendly to use?
changes
Interface: does it communicate well with other
Python has a systems?
unittest
Compatibility: does it work on all browsers and
module
devices?
Django has a
django.test Performance: good response time in adverse
scenarios?
module, and
Testing and Deployment 1
, can also use Security: is app data secure, and users
Selenium protected?
Deployment is
installing a web Unit Testing
application on a
server, can be Testing a specific feature of your
static or dynamic application for a particular behaviour
Cron jobs are or assumption
regular, scheduled
jobs used to Automation of unit tests allows for tests to be
backup data rerun once application has been modified
regularly, send (continuous testing)
emails, update DB, Runs in memory so it doesn’t change your
etc. database
Precedes integration (interface) testing
‼️ Python has a unittest module to run unit
tests
Django has a django.test module to run
tests, which extends the Python unittest
Testing and Deployment 2