Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: psycopg2-binary version fix #1172

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/api/dao/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def assign_new_user(user_id: int, data: Dict[str, str]):
new_admin_user = UserModel.find_by_id(new_admin_user_id)

if new_admin_user:

if new_admin_user.is_admin:
return messages.USER_IS_ALREADY_AN_ADMIN, HTTPStatus.BAD_REQUEST

Expand Down Expand Up @@ -82,7 +81,6 @@ def revoke_admin_user(user_id: int, data: Dict[str, str]):
return messages.USER_NOT_FOUND, HTTPStatus.NOT_FOUND

if new_admin_user:

if not new_admin_user.is_admin:
return messages.USER_IS_NOT_AN_ADMIN, HTTPStatus.BAD_REQUEST

Expand Down
1 change: 0 additions & 1 deletion app/api/dao/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def delete_user(user_id: int):

# check if this user is the only admin
if user.is_admin:

admins_list_count = len(UserModel.get_all_admins())
if admins_list_count <= UserDAO.MIN_NUMBER_OF_ADMINS:
return messages.USER_CANT_DELETE, HTTPStatus.BAD_REQUEST
Expand Down
1 change: 0 additions & 1 deletion app/api/resources/mentorship_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def post(cls):

@staticmethod
def is_valid_data(data):

# Verify if request body has required fields
if "mentor_id" not in data:
return messages.MENTOR_ID_FIELD_IS_MISSING
Expand Down
1 change: 0 additions & 1 deletion app/api/resources/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def post(cls, relation_id):

@staticmethod
def is_valid_data(data):

if "description" not in data:
return messages.DESCRIPTION_FIELD_IS_MISSING

Expand Down
2 changes: 0 additions & 2 deletions app/database/models/mentorship_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def __init__(
notes,
tasks_list,
):

self.action_user_id = action_user_id
self.mentor = mentor_user
self.mentee = mentee_user # same as mentee_user.mentee_relations.append(self)
Expand Down Expand Up @@ -99,7 +98,6 @@ def json(self):

@classmethod
def find_by_id(cls, _id) -> "MentorshipRelationModel":

"""Returns the mentorship that has the passed id.
Args:
_id: The id of a mentorship.
Expand Down
51 changes: 46 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
alembic==1.11.3
aniso8601==9.0.1
APScheduler==3.7.0
coverage==5.5
Flask==1.0.2
attrs==23.1.0
blinker==1.6.2
cfgv==3.2.0
click==7.1.2
coverage==7.2.7
distlib==0.3.7
filelock==3.12.2
Flask==1.1.4
Flask-JWT-Extended==3.25.0
Flask-Mail==0.9.1
Flask-Migrate==2.5.3
flask-restx==0.5.0
flask-restx==1.1.0
Flask-SQLAlchemy==2.5.1
Flask-Testing==0.8.1
greenlet==2.0.2
gunicorn==20.0.4
psycopg2-binary==2.8.6
identify==2.5.24
idna==3.4
importlib-metadata==6.7.0
importlib-resources==5.12.0
itsdangerous==1.1.0
Jinja2==2.11.3
jsonschema==4.17.3
jsonschema-specifications==0.1.3
Mako==1.2.4
MarkupSafe==2.0.1
multidict==6.0.4
mypy-extensions==1.0.0
nodeenv==1.8.0
packaging==23.1
pathspec==0.11.2
pkgutil_resolve_name==1.3.10
platformdirs==3.10.0
pre-commit==2.21.0
psycopg2-binary==2.9.6
PyJWT==1.7.1
pyrsistent==0.19.3
python-dotenv==0.18.0
pytz==2023.3
PyYAML==6.0.1
referencing==0.8.9
six==1.11.0
pre-commit
SQLAlchemy==1.4.0
tomli==2.0.1
typed-ast==1.5.5
typing_extensions==4.7.1
tzlocal==2.1
virtualenv==20.24.3
Werkzeug==1.0.1
yarl==1.9.2
zipp==3.15.0
9 changes: 0 additions & 9 deletions tests/admin/test_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class TestAdminDao(BaseTestCase):
"""

def test_dao_assign_new_admin_valid_user(self):

dao = AdminDAO()

user = UserModel(
Expand Down Expand Up @@ -44,7 +43,6 @@ def test_dao_assign_new_admin_valid_user(self):
"""

def test_dao_assign_new_admin_by_normal_user(self):

dao = AdminDAO()

user = UserModel(
Expand Down Expand Up @@ -73,7 +71,6 @@ def test_dao_assign_new_admin_by_normal_user(self):
"""

def test_dao_assign_admin_role_to_non_existing_user(self):

dao = AdminDAO()

data = dict(user_id=123)
Expand All @@ -89,7 +86,6 @@ def test_dao_assign_admin_role_to_non_existing_user(self):
"""

def test_dao_assign_admin_role_to_admin_user(self):

dao = AdminDAO()

user = UserModel(
Expand Down Expand Up @@ -122,7 +118,6 @@ def test_dao_assign_admin_role_to_admin_user(self):
"""

def test_dao_assign_admin_role_to_myself(self):

dao = AdminDAO()

user = UserModel(
Expand Down Expand Up @@ -155,7 +150,6 @@ def test_dao_assign_admin_role_to_myself(self):
"""

def test_dao_revoke_admin_role_to_valid_user(self):

dao = AdminDAO()

user = UserModel(
Expand Down Expand Up @@ -184,7 +178,6 @@ def test_dao_revoke_admin_role_to_valid_user(self):
"""

def test_dao_revoke_admin_role_by_non_admin_user(self):

dao = AdminDAO()

user = UserModel(
Expand All @@ -211,7 +204,6 @@ def test_dao_revoke_admin_role_by_non_admin_user(self):
"""

def test_dao_revoke_admin_role_to_non_existing_user(self):

dao = AdminDAO()

data = dict(user_id=123)
Expand All @@ -227,7 +219,6 @@ def test_dao_revoke_admin_role_to_non_existing_user(self):
"""

def test_dao_revoke_admin_role_to_non_admin_user(self):

dao = AdminDAO()

user = UserModel(
Expand Down
2 changes: 0 additions & 2 deletions tests/cron_job_functions/test_mentorship_completion_cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class TestCompleteMentorshipRelationCronFunction(BaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down Expand Up @@ -105,7 +104,6 @@ def get_test_app(self):

@patch("run.application", side_effect=get_test_app)
def test_complete_mentorship_relations_accepted(self, get_test_app_fn):

self.assertEqual(
MentorshipRelationState.ACCEPTED, self.mentorship_relation_1.state
)
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/relation_base_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class MentorshipRelationBaseTestCase(BaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_api_cancel_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestCancelMentorshipRelationApi(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_api_delete_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestDeleteMentorshipRequestApi(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_api_list_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class TestListMentorshipRelationsApi(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_api_reject_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestRejectMentorshipRequestApi(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_dao_accept_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class TestMentorshipRelationAcceptRequestDAO(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_dao_cancel_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestMentorshipRelationListingDAO(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
3 changes: 0 additions & 3 deletions tests/mentorship_relation/test_dao_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class TestMentorshipRelationCreationDAO(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
def setUp(self):
super().setUp()
Expand Down Expand Up @@ -160,7 +159,6 @@ def test_dao_create_mentorship_relation_with_non_existent_mentee(self):
self.assertIsNone(query_mentorship_relation)

def test_dao_create_mentorship_relation_with_mentee_already_in_relation(self):

self.mentorship_relation = MentorshipRelationModel(
action_user_id=self.admin_user.id,
mentor_user=self.admin_user,
Expand Down Expand Up @@ -196,7 +194,6 @@ def test_dao_create_mentorship_relation_with_mentee_already_in_relation(self):
self.assertTrue(1, len(query_mentorship_relations))

def test_dao_create_mentorship_relation_with_mentor_already_in_relation(self):

self.mentorship_relation = MentorshipRelationModel(
action_user_id=self.admin_user.id,
mentor_user=self.admin_user,
Expand Down
5 changes: 0 additions & 5 deletions tests/mentorship_relation/test_dao_delete_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestMentorshipRelationDeleteDAO(BaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down Expand Up @@ -69,7 +68,6 @@ def setUp(self):
db.session.commit()

def test_dao_delete_non_existing_mentorship_request(self):

result = MentorshipRelationDAO.delete_request(self.first_user.id, 123)

self.assertEqual(
Expand All @@ -83,7 +81,6 @@ def test_dao_delete_non_existing_mentorship_request(self):
)

def test_dao_sender_does_not_exist(self):

result = MentorshipRelationDAO.delete_request(123, self.mentorship_relation.id)

self.assertEqual((messages.USER_DOES_NOT_EXIST, HTTPStatus.NOT_FOUND), result)
Expand All @@ -94,7 +91,6 @@ def test_dao_sender_does_not_exist(self):
)

def test_dao_receiver_tries_to_delete_mentorship_request(self):

result = MentorshipRelationDAO.delete_request(
self.second_user.id, self.mentorship_relation.id
)
Expand Down Expand Up @@ -126,7 +122,6 @@ def test_dao_sender_delete_mentorship_request(self):
)

def test_dao_user_not_involved_tries_to_delete_mentorship_request(self):

result = MentorshipRelationDAO.delete_request(
self.admin_user.id, self.mentorship_relation.id
)
Expand Down
4 changes: 0 additions & 4 deletions tests/mentorship_relation/test_dao_list_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class TestListMentorshipRelationsDAO(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
def setUp(self):
super().setUp()
Expand Down Expand Up @@ -63,7 +62,6 @@ def setUp(self):
db.session.commit()

def test_dao_list_past_mentorship_relations(self):

result = MentorshipRelationDAO.list_past_mentorship_relations(
user_id=self.first_user.id
)
Expand All @@ -74,7 +72,6 @@ def test_dao_list_past_mentorship_relations(self):
self.assertEqual(expected_response, result[0])

def test_dao_list_current_mentorship_relation(self):

result = MentorshipRelationDAO.list_current_mentorship_relation(
user_id=self.first_user.id
)
Expand All @@ -91,7 +88,6 @@ def test_dao_list_non_existing_current_mentorship_relation(self):
self.assertEqual(expected_response, result)

def test_dao_list_pending_mentorship_relation(self):

result = MentorshipRelationDAO.list_pending_mentorship_relations(
user_id=self.first_user.id
)
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_dao_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestMentorshipRelationListingDAO(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
def setUp(self):
super().setUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class TestMentorshipRelationListingDAO(MentorshipRelationBaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/mentorship_relation/test_database_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class TestMentorshipRelationModel(BaseTestCase):

# Setup consists of adding 2 users into the database
def setUp(self):
db.create_all()
Expand Down
1 change: 0 additions & 1 deletion tests/tasks/tasks_base_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class TasksBaseTestCase(BaseTestCase):

# Setup consists of adding 2 users into the database
# User 1 is the mentorship relation requester = action user
# User 2 is the receiver
Expand Down
1 change: 0 additions & 1 deletion tests/tasks/test_api_complete_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_complete_task_api_resource_non_auth(self):
self.assertDictEqual(expected_response, json.loads(actual_response.data))

def test_complete_task_api(self):

relation = MentorshipRelationModel.find_by_id(
self.mentorship_relation_w_second_user.id
)
Expand Down
Loading
Loading