-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #441 from MetaPhase-Consulting/chore/tests-11162020
Increase test coverage
- Loading branch information
Showing
8 changed files
with
107 additions
and
272 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[run] | ||
omit = *apps.py, *wsgi.py, manage.py, **/settings.py, */venv/*, **/soap_api_test.py, */saml2/*, **/locustfile.py, */common/renderers.py | ||
omit = *apps.py, *wsgi.py, manage.py, show_logo.py, **/settings.py, */venv/*, */tests/mommy_recipes.py, **/soap_api_test.py, */saml2/*, **/locustfile.py, */common/renderers.py |
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ __pycache__/ | |
.Python | ||
env/ | ||
build/ | ||
coverage.html/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
|
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import json | ||
import pytest | ||
from model_mommy import mommy | ||
from rest_framework import status | ||
|
||
from talentmap_api.feature_flags.models import FeatureFlags | ||
|
||
|
||
@pytest.fixture | ||
def test_featureflags_fixture(): | ||
if FeatureFlags.objects.first() is None: | ||
mommy.make(FeatureFlags, feature_flags={"test": 1}, date_updated="01-10-2020 17:34:31:112") | ||
|
||
|
||
@pytest.mark.usefixtures("test_featureflags_fixture") | ||
@pytest.mark.django_db(transaction=True) | ||
def test_get_featureflags(authorized_client, authorized_user): | ||
featureflag = FeatureFlags.objects.first() | ||
|
||
response = authorized_client.get('/api/v1/featureflags/') | ||
|
||
assert response.status_code == status.HTTP_200_OK | ||
assert response.data["test"] == featureflag.feature_flags["test"] |
Oops, something went wrong.