"""Test for a vendor model.""" from oto import response import pytest from content_review.models import review_status_type from content_review.utils import db_operations @pytest.fixture def db_fixture(): """Set up the vendor table.""" db_operations.create_tables() db_operations.seed_review_status_type_table() @pytest.fixture() def get_all_status_types(): """Successful response for getting all review status types.""" return response.Response([ {'status_type_id': 1, 'status': 'Approved'}, {'status_type_id': 2, 'status': 'Rejected'}, {'status_type_id': 3, 'status': 'Pending'} ]) @pytest.fixture() def get_all_status_types_flipped_dict(): """Successful response for getting all review status types flipped.""" return response.Response({ 'Approved': 1, 'Rejected': 2, 'Pending': 3 }) def test_get_status_types(db_fixture, get_all_status_types): """Test getting review status types.""" actual_response = review_status_type.get_status_types() assert get_all_status_types.message == actual_response.message def test_get_status_types_flipped_dict( db_fixture, get_all_status_types_flipped_dict): """Test getting review status types flipped.""" actual_response = review_status_type.get_status_types(flipped_dict=True) assert get_all_status_types_flipped_dict.message == actual_response.message