-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
29 additions
and
28 deletions.
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
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 |
---|---|---|
|
@@ -7,15 +7,15 @@ | |
} | ||
|
||
test_admin_user_2 = { | ||
"name": "Admin_2", | ||
"name": "Adminb", | ||
"email": "[email protected]", | ||
"username": "admin2_username", | ||
"password": "admin2_pwd", | ||
"terms_and_conditions_checked": True, | ||
} | ||
|
||
test_admin_user_3 = { | ||
"name": "Admin_3", | ||
"name": "Adminc", | ||
"email": "[email protected]", | ||
"username": "admin3_username", | ||
"password": "admin3_pwd", | ||
|
@@ -42,23 +42,23 @@ | |
} | ||
|
||
user3 = { | ||
"name": "s_t-r$a/n'ge name", | ||
"name": "strange name", | ||
"email": "[email protected]", | ||
"username": "user3", | ||
"password": "user3_pwd", | ||
"terms_and_conditions_checked": True, | ||
} | ||
|
||
user4 = { | ||
"name": "[email protected]", | ||
"name": "userc", | ||
"email": "[email protected]", | ||
"username": "user4", | ||
"password": "user4_pwd", | ||
"terms_and_conditions_checked": True, | ||
} | ||
|
||
user5 = { | ||
"name": "[email protected]", | ||
"name": "userd", | ||
"email": "[email protected]", | ||
"username": "user5", | ||
"password": "user5_pwd", | ||
|
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 |
---|---|---|
|
@@ -26,7 +26,7 @@ def setUp(self): | |
super().setUp() | ||
self.first_user = UserModel( | ||
password=user1["password"], | ||
name="User1", | ||
name="User", | ||
email="[email protected]", | ||
username="user_not_admin", | ||
terms_and_conditions_checked=True, | ||
|
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 |
---|---|---|
|
@@ -15,8 +15,8 @@ class TestHomeStatisticsApi(BaseTestCase): | |
def setUp(self): | ||
super().setUp() | ||
|
||
self.user1 = UserModel("User1", "user1", "__test__", "[email protected]", True) | ||
self.user2 = UserModel("User2", "user2", "__test__", "[email protected]", True) | ||
self.user1 = UserModel("UserA", "user1", "__test__", "[email protected]", True) | ||
self.user2 = UserModel("UserB", "user2", "__test__", "[email protected]", True) | ||
self.user1.available_to_mentor = True | ||
self.user1.is_email_verified = True | ||
self.user2.need_mentoring = True | ||
|
@@ -56,14 +56,14 @@ def test_pending_requests_auth(self): | |
creation_date=start_date, | ||
end_date=end_date, | ||
state=MentorshipRelationState.PENDING, | ||
notes="", | ||
notes=None, | ||
tasks_list=tasks_list, | ||
) | ||
|
||
db.session.add(mentorship_relation) | ||
db.session.commit() | ||
expected_response = { | ||
"name": "User1", | ||
"name": "UserA", | ||
"pending_requests": 1, | ||
"accepted_requests": 0, | ||
"rejected_requests": 0, | ||
|
@@ -92,14 +92,14 @@ def test_accepted_requests_auth(self): | |
creation_date=start_date, | ||
end_date=end_date, | ||
state=MentorshipRelationState.ACCEPTED, | ||
notes="", | ||
notes=None, | ||
tasks_list=tasks_list, | ||
) | ||
|
||
db.session.add(mentorship_relation) | ||
db.session.commit() | ||
expected_response = { | ||
"name": "User1", | ||
"name": "UserA", | ||
"pending_requests": 0, | ||
"accepted_requests": 1, | ||
"rejected_requests": 0, | ||
|
@@ -128,14 +128,14 @@ def test_rejected_requests(self): | |
creation_date=start_date, | ||
end_date=end_date, | ||
state=MentorshipRelationState.REJECTED, | ||
notes="", | ||
notes=None, | ||
tasks_list=tasks_list, | ||
) | ||
|
||
db.session.add(mentorship_relation) | ||
db.session.commit() | ||
expected_response = { | ||
"name": "User1", | ||
"name": "UserA", | ||
"pending_requests": 0, | ||
"accepted_requests": 0, | ||
"rejected_requests": 1, | ||
|
@@ -164,14 +164,14 @@ def test_completed_relations(self): | |
creation_date=start_date, | ||
end_date=end_date, | ||
state=MentorshipRelationState.COMPLETED, | ||
notes="", | ||
notes=None, | ||
tasks_list=tasks_list, | ||
) | ||
|
||
db.session.add(mentorship_relation) | ||
db.session.commit() | ||
expected_response = { | ||
"name": "User1", | ||
"name": "UserA", | ||
"pending_requests": 0, | ||
"accepted_requests": 0, | ||
"rejected_requests": 0, | ||
|
@@ -199,14 +199,14 @@ def test_cancelled_relations(self): | |
creation_date=start_date, | ||
end_date=end_date, | ||
state=MentorshipRelationState.CANCELLED, | ||
notes="", | ||
notes=None, | ||
tasks_list=tasks_list, | ||
) | ||
|
||
db.session.add(mentorship_relation) | ||
db.session.commit() | ||
expected_response = { | ||
"name": "User1", | ||
"name": "UserA", | ||
"pending_requests": 0, | ||
"accepted_requests": 0, | ||
"rejected_requests": 0, | ||
|
@@ -253,15 +253,15 @@ def test_achievements(self): | |
creation_date=start_date, | ||
end_date=end_date, | ||
state=MentorshipRelationState.ACCEPTED, | ||
notes="", | ||
notes=None, | ||
tasks_list=tasks_list, | ||
) | ||
|
||
db.session.add(mentorship_relation) | ||
db.session.commit() | ||
|
||
expected_response = { | ||
"name": "User1", | ||
"name": "UserA", | ||
"pending_requests": 0, | ||
"accepted_requests": 1, | ||
"rejected_requests": 0, | ||
|
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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ class TestUserDao(BaseTestCase): | |
def test_dao_create_user(self): | ||
dao = UserDAO() | ||
data = dict( | ||
name="User2", | ||
name="UserB", | ||
username="user2", | ||
email="[email protected]", | ||
password="test_password", | ||
|
@@ -30,7 +30,7 @@ def test_dao_create_user(self): | |
user = UserModel.query.filter_by(email="[email protected]").first() | ||
self.assertTrue(user is not None) | ||
self.assertTrue(user.id is not None) | ||
self.assertTrue(user.name == "User2") | ||
self.assertTrue(user.name == "UserB") | ||
self.assertTrue(user.username == "user2") | ||
self.assertTrue(user.email == "[email protected]") | ||
self.assertFalse(user.is_admin) | ||
|
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ def test_is_first_user_admin(self): | |
|
||
def test_second_user_cannot_be_admin(self): | ||
user = UserModel( | ||
name="User1", | ||
name="UserA", | ||
email="[email protected]", | ||
username="user_not_admin", | ||
password="user1_password", | ||
|
@@ -44,7 +44,7 @@ def test_second_user_cannot_be_admin(self): | |
user = UserModel.query.filter_by(email="[email protected]").first() | ||
self.assertTrue(user is not None) | ||
self.assertTrue(user.id is not None) | ||
self.assertTrue(user.name == "User1") | ||
self.assertTrue(user.name == "UserA") | ||
self.assertTrue(user.username == "user_not_admin") | ||
self.assertTrue(user.email == "[email protected]") | ||
self.assertFalse(user.password_hash == "user1_password") | ||
|