Commit 6dd9c89b by Will Daly

Merge pull request #175 from edx/will/update-fixtures-answer

Update fixtures for new submission field format
parents e313f724 70bfb6fd
...@@ -54,5 +54,7 @@ node_modules ...@@ -54,5 +54,7 @@ node_modules
npm-debug.log npm-debug.log
coverage coverage
# Dev database # tim-specific
timdb timdb
testdb
fixture_err.log
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
"submitted_at": "2014-03-12T11:37:56Z", "submitted_at": "2014-03-12T11:37:56Z",
"created_at": "2014-03-12T11:37:56Z", "created_at": "2014-03-12T11:37:56Z",
"student_item": 9, "student_item": 9,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "c18b952c-a9da-11e3-9ccf-080027880ca6" "uuid": "c18b952c-a9da-11e3-9ccf-080027880ca6"
} }
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
"submitted_at": "2014-03-12T11:37:51Z", "submitted_at": "2014-03-12T11:37:51Z",
"created_at": "2014-03-12T11:37:51Z", "created_at": "2014-03-12T11:37:51Z",
"student_item": 8, "student_item": 8,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "beb581f0-a9da-11e3-9b83-080027880ca6" "uuid": "beb581f0-a9da-11e3-9b83-080027880ca6"
} }
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
"submitted_at": "2014-03-12T11:37:20Z", "submitted_at": "2014-03-12T11:37:20Z",
"created_at": "2014-03-12T11:37:20Z", "created_at": "2014-03-12T11:37:20Z",
"student_item": 7, "student_item": 7,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "ac0539f6-a9da-11e3-af02-080027880ca6" "uuid": "ac0539f6-a9da-11e3-af02-080027880ca6"
} }
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
"submitted_at": "2014-03-12T11:36:51Z", "submitted_at": "2014-03-12T11:36:51Z",
"created_at": "2014-03-12T11:36:51Z", "created_at": "2014-03-12T11:36:51Z",
"student_item": 6, "student_item": 6,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "9af86840-a9da-11e3-b156-080027880ca6" "uuid": "9af86840-a9da-11e3-b156-080027880ca6"
} }
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
"submitted_at": "2014-03-12T11:36:10Z", "submitted_at": "2014-03-12T11:36:10Z",
"created_at": "2014-03-12T11:36:10Z", "created_at": "2014-03-12T11:36:10Z",
"student_item": 5, "student_item": 5,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "822a5224-a9da-11e3-8f75-080027880ca6" "uuid": "822a5224-a9da-11e3-8f75-080027880ca6"
} }
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
"submitted_at": "2014-03-12T11:36:04Z", "submitted_at": "2014-03-12T11:36:04Z",
"created_at": "2014-03-12T11:36:04Z", "created_at": "2014-03-12T11:36:04Z",
"student_item": 4, "student_item": 4,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "7e8ededc-a9da-11e3-89ce-080027880ca6" "uuid": "7e8ededc-a9da-11e3-89ce-080027880ca6"
} }
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
"submitted_at": "2014-03-12T11:35:22Z", "submitted_at": "2014-03-12T11:35:22Z",
"created_at": "2014-03-12T11:35:22Z", "created_at": "2014-03-12T11:35:22Z",
"student_item": 3, "student_item": 3,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "65650b3e-a9da-11e3-8b23-080027880ca6" "uuid": "65650b3e-a9da-11e3-8b23-080027880ca6"
} }
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
"submitted_at": "2014-03-12T11:35:03Z", "submitted_at": "2014-03-12T11:35:03Z",
"created_at": "2014-03-12T11:35:03Z", "created_at": "2014-03-12T11:35:03Z",
"student_item": 2, "student_item": 2,
"answer": "Test submission", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "5a14d39a-a9da-11e3-b964-080027880ca6" "uuid": "5a14d39a-a9da-11e3-b964-080027880ca6"
} }
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
"submitted_at": "2014-03-12T11:34:55Z", "submitted_at": "2014-03-12T11:34:55Z",
"created_at": "2014-03-12T11:34:55Z", "created_at": "2014-03-12T11:34:55Z",
"student_item": 1, "student_item": 1,
"answer": "Test submision", "raw_answer": "{\"text\": \"Test submission\"}",
"attempt_number": 1, "attempt_number": 1,
"uuid": "55c6f020-a9da-11e3-976d-080027880ca6" "uuid": "55c6f020-a9da-11e3-976d-080027880ca6"
} }
...@@ -208,4 +208,4 @@ ...@@ -208,4 +208,4 @@
"submission": 8 "submission": 8
} }
} }
] ]
\ No newline at end of file
...@@ -107,4 +107,4 @@ ...@@ -107,4 +107,4 @@
"status_changed": "2014-03-12T11:34:55Z" "status_changed": "2014-03-12T11:34:55Z"
} }
} }
] ]
\ No newline at end of file
...@@ -12,3 +12,22 @@ python manage.py test ...@@ -12,3 +12,22 @@ python manage.py test
echo "Running JavaScript tests..." echo "Running JavaScript tests..."
npm test npm test
echo "Testing fixture import..."
# This uses the test database, because we're using test settings
rm -rf testdb
python manage.py syncdb --migrate --noinput -v 0
# There's an issue in Django 1.4 about loaddata not exiting with status 1 on error:
# https://code.djangoproject.com/ticket/20538
# Instead, we check if we can successfully match error text in the command output
if python manage.py loaddata \
fixtures/submission.json fixtures/assessments.json fixtures/workflow.json 2>&1 \
| tee fixture_err.log \
| grep -q "[Pp]roblem"; then
echo "Problem occurred when loading fixture file:"
cat fixture_err.log
exit 1
else
echo "Success!"
fi
...@@ -21,6 +21,19 @@ NOSE_ARGS = [ ...@@ -21,6 +21,19 @@ NOSE_ARGS = [
'--cover-erase', '--cover-erase',
] ]
# This will still use an in-memory database for the unit tests,
# but will create an on-disk database for testing migrations/fixture installation.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'testdb',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Configure lettuce # Configure lettuce
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment