Skip to content
Snippets Groups Projects
Commit 147663fb authored by bmedx's avatar bmedx
Browse files

Update fix_ungraded_certs to Django 1.11 spec

parent 50744e0a
No related merge requests found
......@@ -2,7 +2,6 @@
Management command which fixes ungraded certificates for students
"""
import logging
from optparse import make_option
from django.core.management.base import BaseCommand
......@@ -23,24 +22,23 @@ class Command(BaseCommand):
and grade them.
"""
option_list = BaseCommand.option_list + (
make_option(
def add_arguments(self, parser):
parser.add_argument(
'-n',
'--noop',
action='store_true',
dest='noop',
default=False,
help="Print but do not update the GeneratedCertificate table"
),
make_option(
)
parser.add_argument(
'-c',
'--course',
metavar='COURSE_ID',
dest='course',
default=False,
help='Grade ungraded users for this course'
),
)
)
def handle(self, *args, **options):
course_id = options['course']
......
"""
Extremely basic tests for the fix_ungraded_certs command
"""
import pytest
from django.core.management import call_command
def test_fix_ungraded_certs_help(capsys):
"""
Basic test to see if the command will parse and get args
"""
with pytest.raises(SystemExit):
call_command('fix_ungraded_certs', '--help')
out, err = capsys.readouterr() # pylint: disable=unused-variable
assert "COURSE_ID" in out
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