Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
abel-andre committed Mar 13, 2019
1 parent 964f215 commit 4637a14
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/routes/features_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from models import PcObject
from tests.conftest import clean_database, TestClient
from tests.test_utils import API_URL, create_user, create_feature
from tests.test_utils import API_URL, create_user


@pytest.mark.standalone
Expand All @@ -12,22 +12,19 @@ class Returns200:
def when_user_is_logged_in(self, app):
# given
user = create_user()
feature1 = create_feature(name='Feature 1', is_active=True)
feature2 = create_feature(name='Feature 2', is_active=False)
PcObject.check_and_save(user, feature1, feature2)
PcObject.check_and_save(user)

# when
response = TestClient().with_auth(user.email)\
response = TestClient().with_auth(user.email) \
.get(API_URL + '/features')

# then
assert response.status_code == 200
assert response.json() == [
{'modelName': 'Feature', 'name': 'Feature 1', 'isActive': True},
{'modelName': 'Feature', 'name': 'Feature 2', 'isActive': False}
{'modelName': 'Feature', 'name': 'show_bookings', 'isActive': True},
{'modelName': 'Feature', 'name': 'show_venues', 'isActive': True}
]


class Returns401:
@clean_database
def when_user_is_not_logged_in(self, app):
Expand Down

0 comments on commit 4637a14

Please sign in to comment.