Skip to content

Commit c5b09e1

Browse files
committed
Added test database docs for running tests locally (fossasia#5539)
* Added package in local installation docs * Added test for authentication * Added docstring for auth test * Unused modules of auth test removed * Changed module import style * test exception handled * User import * Whitespace commit * Add test database instructions * Update local.md * Export csv support for sessions * removed unused packages * continuation line indent' * removed test doc commmit to separate PR * Added test database docs * Added instructions for test database docs
1 parent cb24be3 commit c5b09e1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/installation/local.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,23 @@ sudo -u postgres psql
7373
psql -d postgres
7474
```
7575

76-
* When inside psql, create a user for open-event and then using the user create the database.
76+
* When inside psql, create a user for open-event and then using the user create the database. Also, create a test databse named opev_test for the test suites by dumping the oevent database into it. without this, the tests will not run locally.
7777

7878
For ease of development, you should create Postgres user with the same username as your OS account. If your OS login account is _john_, for example, you should create _john_ user in Postgres. By this, you can skip entering password when using database.
7979

8080
```sql
8181
CREATE USER john WITH PASSWORD 'start';
8282
CREATE DATABASE oevent WITH OWNER john;
83+
CREATE DATABASE opev_test WITH OWNER john;
8384
```
8485

85-
* Once database is created, exit the psql shell with `\q` followed by ENTER.
86+
* To dump the oevent database into opev_test
87+
```sh
88+
psql -U john --password <password> oevent > temp.pgsql
89+
psql -U john opev_test < temp.pgsql
90+
```
91+
92+
* Once the databases are created, exit the psql shell with `\q` followed by ENTER.
8693

8794

8895
* **Step 3** - Create application environment variables.

0 commit comments

Comments
 (0)