Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #5402: State domain refactor #5505

Merged
merged 14 commits into from
Aug 16, 2018
4 changes: 3 additions & 1 deletion core/controllers/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from core.domain import obj_services
from core.domain import rights_manager
from core.domain import search_services
from core.domain import state_domain
from core.domain import stats_domain
from core.domain import stats_services
from core.domain import user_services
Expand Down Expand Up @@ -498,7 +499,8 @@ def post(self, unused_exploration_id):
raise self.PageNotFoundException

self.render_json({
'yaml': exp_services.convert_state_dict_to_yaml(state_dict, width),
'yaml': state_domain.State.convert_state_dict_to_yaml(
state_dict, width),
})


Expand Down
3 changes: 2 additions & 1 deletion core/controllers/feedback_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from core.domain import exp_services
from core.domain import feedback_services
from core.domain import rights_manager
from core.domain import state_domain
from core.domain import suggestion_services
from core.domain import user_services
from core.platform import models
Expand Down Expand Up @@ -505,7 +506,7 @@ def test_feedback_threads(self):

def test_feedback_threads_with_suggestions(self):
with self.swap(constants, 'ENABLE_GENERALIZED_FEEDBACK_THREADS', True):
new_content = exp_domain.SubtitledHtml(
new_content = state_domain.SubtitledHtml(
'content', 'new content html').to_dict()
change_cmd = {
'cmd': exp_domain.CMD_EDIT_STATE_PROPERTY,
Expand Down
3 changes: 2 additions & 1 deletion core/controllers/old_feedback_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import rights_manager
from core.domain import state_domain
from core.domain import suggestion_services
from core.domain import user_services
from core.platform import models
Expand Down Expand Up @@ -379,7 +380,7 @@ def setUp(self):

def test_feedback_threads_with_suggestions(self):
with self.swap(constants, 'ENABLE_GENERALIZED_FEEDBACK_THREADS', False):
new_content = exp_domain.SubtitledHtml(
new_content = state_domain.SubtitledHtml(
'content', 'new content html').to_dict()
change_cmd = {
'cmd': exp_domain.CMD_EDIT_STATE_PROPERTY,
Expand Down
5 changes: 3 additions & 2 deletions core/controllers/old_suggestion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import rights_manager
from core.domain import state_domain
from core.domain import suggestion_services
from core.domain import user_services
from core.platform import models
Expand Down Expand Up @@ -64,7 +65,7 @@ def setUp(self):
self.EXP_ID, self.editor_id, ['State 1', 'State 2', 'State 3'],
['TextInput'], category='Algebra'))

self.old_content = exp_domain.SubtitledHtml(
self.old_content = state_domain.SubtitledHtml(
'content', 'old content html').to_dict()

exploration.states['State 1'].update_content(self.old_content)
Expand All @@ -77,7 +78,7 @@ def setUp(self):
self.editor, self.EXP_ID, self.owner_id,
rights_manager.ROLE_EDITOR)

self.new_content = exp_domain.SubtitledHtml(
self.new_content = state_domain.SubtitledHtml(
'content', 'new content html').to_dict()

self.logout()
Expand Down
5 changes: 3 additions & 2 deletions core/controllers/suggestion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from core.domain import question_domain
from core.domain import question_services
from core.domain import rights_manager
from core.domain import state_domain
from core.domain import suggestion_services
from core.domain import user_services
from core.platform import models
Expand Down Expand Up @@ -67,7 +68,7 @@ def setUp(self):
self.EXP_ID, self.editor_id, ['State 1', 'State 2', 'State 3'],
['TextInput'], category='Algebra'))

self.old_content = exp_domain.SubtitledHtml(
self.old_content = state_domain.SubtitledHtml(
'content', 'old content html').to_dict()

exploration.states['State 1'].update_content(self.old_content)
Expand All @@ -80,7 +81,7 @@ def setUp(self):
self.editor, self.EXP_ID, self.owner_id,
rights_manager.ROLE_EDITOR)

self.new_content = exp_domain.SubtitledHtml(
self.new_content = state_domain.SubtitledHtml(
'content', 'new content html').to_dict()

self.logout()
Expand Down
Loading