Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
RSS cloud
Jump to:

Unit Tests

1 of 419 articles shown, currently no other people reading this forum.
From: Timothy F.
Date: Tue 19th May 2020, 9:30am


"Pallavi Verma" <22*0*7*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Hi,
> I am getting a bit confused in how to create a test database.
> Do we need to delete our migrations folder and app.db for our existing project in 
> order to initialize a test database?
> Will the db initialization create app.db again?
> Thanks

You shouldn't need to remove the app database. You just need to create a new Testing 
configuration pointing to the test database. I wnet through this in the Testing 
workshop. I did need to remove the migrations etc when I set up migrations for the 
test database, but this was a mistake. The test database shouldn't need any 
migrations as it is built just to run the tests. (Migrations are for persistent 

Then the db init should just create test.db (if that's what you had in your confug 

You can also set up an in-memory sqlite database;

Related articles

Unit Tests (both) RSS
├─ original   Tue 19th May 2020, 12:36am, Pallavi V.
└─ THIS   Tue 19th May 2020, 9:30am, Timothy F.
This Page

Program written by: [email protected]
Feedback welcome
Last modified:  9:57am Nov 18 2020