-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for UserModel and create user in test_spark_app_config_mo…
…del.py
- Loading branch information
1 parent
93f77db
commit 87d6802
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
from database import db | ||
from app.models.spark_app_config import SparkAppConfigModel | ||
from app.models.notebook import NotebookModel | ||
from app.models.user import UserModel | ||
|
||
class SparkAppConfigModelTestCase(unittest.TestCase): | ||
|
||
|
@@ -20,8 +21,17 @@ def tearDown(self): | |
|
||
def test_spark_app_config_model(self): | ||
with self.app.app_context(): | ||
# Create user | ||
user = UserModel(name='testuser', email='[email protected]') | ||
password = 'test_password' | ||
user.set_password(password) | ||
db.session.add(user) | ||
db.session.commit() | ||
|
||
self.assert_Equal(user.id, 1) | ||
|
||
# Create notebook | ||
notebook = NotebookModel(path='test_notebook', user_id=1) | ||
notebook = NotebookModel(name = 'test_notebook', path='test_notebook', user_id=1) | ||
db.session.add(notebook) | ||
db.session.commit() | ||
|
||
|