Skip to content

Commit

Permalink
removed id testing from test_accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
rpkenney committed Nov 24, 2023
1 parent 3985612 commit 3016463
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
sys.path.append(str(Path(__file__).resolve().parents[1]))
#pylint: disable=wrong-import-position
from src.recommenderapp.utils import create_colored_tags, \
beautify_feedback_data, create_movie_genres, send_email_to_user, createAccount, logintoAccount
beautify_feedback_data, create_movie_genres, send_email_to_user, createAccount, logintoAccount, getWallPosts
#pylint: enable=wrong-import-position

warnings.filterwarnings("ignore")
Expand Down Expand Up @@ -86,6 +86,7 @@ def test_accounts(self):
host='127.0.0.1')
executor = db.cursor()
executor.execute("USE testDB;")
executor.execute("DELETE FROM users WHERE username = 'testUser'")
createAccount(db, "test@test.com", "testUser", "testPassword")
expectedUserName="testUser"
expectedEmail = "test@test.com"
Expand All @@ -102,11 +103,21 @@ def test_accounts(self):
self.assertEqual(expectedEmail, dbResult[0][2])
self.assertEqual(h.hexdigest(), dbResult[0][3])
id = logintoAccount(db, "testUser", "testPassword")
expectedId = 1
self.assertEqual(expectedId, id)
fail = logintoAccount(db, "testUser", "wrongPassword")
self.assertIsNone(fail)
db.close()

def test_get_wall_posts(self):
"""
Test case 6
"""
load_dotenv()
db = mysql.connector.connect(user='root', password=os.getenv('DB_PASSWORD'),
host='127.0.0.1')
executor = db.cursor()
executor.execute("USE testDB;")
a = getWallPosts(db)
print(a)



Expand Down

0 comments on commit 3016463

Please sign in to comment.