Skip to content

Commit

Permalink
add accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedHamed12 committed Apr 4, 2024
1 parent b9c54c6 commit fb6fd52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions project/accounts/management/commands/test_db_destroy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# project/app_name/management/commands/test_db_destroy.py

from django.core.management.base import BaseCommand
from django.db import connections

class Command(BaseCommand):
help = 'Destroy the test database'

def handle(self, *args, **options):
connection = connections['default']
cursor = connection.cursor()
cursor.execute('DROP DATABASE IF EXISTS test_hospital')
self.stdout.write(self.style.SUCCESS('Test database destroyed successfully.'))
print("Test database destroyed successfully.")
4 changes: 4 additions & 0 deletions project/project/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
db_config['ATOMIC_REQUESTS'] = True
DATABASES = {
'default': db_config,
"TEST": {
"NAME": "my_testdatabase",
},

}

0 comments on commit fb6fd52

Please # to comment.