Commit e3a70ce6 by Sarina Canelake

Fix for CourseFactory bug - course object not saved after setattr called

parent ede0916a
...@@ -56,6 +56,8 @@ class CourseFactory(XModuleFactory): ...@@ -56,6 +56,8 @@ class CourseFactory(XModuleFactory):
for k, v in kwargs.iteritems(): for k, v in kwargs.iteritems():
setattr(new_course, k, v) setattr(new_course, k, v)
# Save the attributes we just set
new_course.save()
# Update the data in the mongo datastore # Update the data in the mongo datastore
store.update_item(new_course) store.update_item(new_course)
return new_course return new_course
...@@ -156,6 +158,7 @@ class ItemFactory(XModuleFactory): ...@@ -156,6 +158,7 @@ class ItemFactory(XModuleFactory):
for attr, val in kwargs.items(): for attr, val in kwargs.items():
setattr(module, attr, val) setattr(module, attr, val)
# Save the attributes we just set
module.save() module.save()
store.update_item(module) store.update_item(module)
......
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