Skip to content

Commit

Permalink
fix: Add attempt creation test util (#1241)
Browse files Browse the repository at this point in the history
* fix: Add attempt creation test util

* Add test files to codecov ignore list

* Fix codecov.yml
  • Loading branch information
faucomte97 authored Oct 29, 2021
1 parent 60fe5d6 commit 60573ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ comment:
require_changes: false
require_base: no
require_head: yes
branches: !master
branches:
- "!master"

ignore:
- "game/tests/*"
- "game/tests/*.py"
- "game/tests/**/*.py"
8 changes: 8 additions & 0 deletions game/tests/utils/attempt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from game.models import Attempt


def create_attempt(student, level, score):
attempt = Attempt(level=level, student=student, score=score, is_best_attempt=True)
attempt.save()

return attempt
2 changes: 1 addition & 1 deletion game/tests/utils/level.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_save_level(teacher):
"destinations": "[[3,4]]",
}
level = Level(default=False, anonymous=data["anonymous"])
level.owner = teacher.user.user.userprofile
level.owner = teacher.user
level_management.save_level(level, data)
level.save()

Expand Down

0 comments on commit 60573ea

Please sign in to comment.