Skip to content
Snippets Groups Projects
Commit 945e60ad authored by fu2662cw's avatar fu2662cw :speech_balloon:
Browse files

Add fixture and test for one sport

parent f843cea9
No related branches found
No related tags found
No related merge requests found
[
{
"model": "quiz.sport",
"pk": 1,
"fields": {
"name": "Jiu Jitsu",
"url": "http://www.test.de"
}
}
]
\ No newline at end of file
......@@ -188,3 +188,18 @@ class CriterionAndQuestionModelTest(TestCase):
Question(text=text, criterion=self.criterion).save()
test_question = Question.objects.first()
self.assertEqual(test_question.text, text)
class FixturesTest(TestCase):
"""
These are the tests for the fixtures in quiz/fixtures.
Fixtures can be used to populate the database which test data.
They can be used in automated tests, but also in development.
"""
fixtures = ["sports.json"]
def test_sports_created_by_fixture(self):
""" If the fixture is loaded there exists a sport with the given data. """
sport = Sport.objects.get(pk=1)
self.assertEqual(sport.name, "Jiu Jitsu")
self.assertEqual(sport.url, "http://www.test.de")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment