Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hongee committed May 24, 2018
1 parent fb4c0bc commit 1c593e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kerckhoff/packages/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def test_PackageVersion_creation(self):
packageA = Package.objects.get(slug="a")
packageA.create_version(testUser, "This version uses Hong Yi")
myPV = PackageVersion.objects.get(package=packageA)

# TODO: individual fields don't really need to be tested - good to keep things shorter
self.assertEqual(myPV.article_data, "Hong Yi")
self.assertEqual(myPV.version_description, "This version uses Hong Yi")
self.assertEqual(myPV.creator.get_username(), "kimjongun")
Expand Down
2 changes: 2 additions & 0 deletions kerckhoff/packages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def list_or_create(request: HttpRequest, pset_slug: str) -> JsonResponse:
# Create object
data = json.loads(request.body)
form_data = PackageForm(data)
# TODO: Refactor this to have the exception automatically thrown and
# serialized by the custom Kerckhoff exception class instead
if form_data.is_valid():
model_instance = form_data.save(commit=False)
print(model_instance)
Expand Down

0 comments on commit 1c593e4

Please sign in to comment.