Commit 71ce4d07 by zubair-arbi

add 'provider_description' field for CreditProvider model

ECOM-1842
parent 8a65167d
......@@ -65,6 +65,7 @@ def get_credit_provider_info(provider_id):
"display_name": "Hogwarts School of Witchcraft and Wizardry",
"provider_url": "https://credit.example.com/",
"provider_status_url": "https://credit.example.com/status/",
"provider_description: "A new model for the Witchcraft and Wizardry School System.",
"enable_integration": False,
"fulfillment_instructions": "
<p>In order to fulfill credit, Hogwarts School of Witchcraft and Wizardry requires learners to:</p>
......@@ -83,6 +84,7 @@ def get_credit_provider_info(provider_id):
"display_name": credit_provider.display_name,
"provider_url": credit_provider.provider_url,
"provider_status_url": credit_provider.provider_status_url,
"provider_description": credit_provider.provider_description,
"enable_integration": credit_provider.enable_integration,
"fulfillment_instructions": credit_provider.fulfillment_instructions
}
......
......@@ -94,6 +94,13 @@ class CreditProvider(TimeStampedModel):
)
)
provider_description = models.TextField(
default="",
help_text=ugettext_lazy(
"Description for the credit provider displayed to users."
)
)
fulfillment_instructions = models.TextField(
null=True,
blank=True,
......
......@@ -48,6 +48,7 @@ class CreditApiTestBase(TestCase):
PROVIDER_NAME = "Hogwarts School of Witchcraft and Wizardry"
PROVIDER_URL = "https://credit.example.com/request"
PROVIDER_STATUS_URL = "https://credit.example.com/status"
PROVIDER_DESCRIPTION = "A new model for the Witchcraft and Wizardry School System."
ENABLE_INTEGRATION = True
FULFILLMENT_INSTRUCTIONS = "Sample fulfillment instruction for credit completion."
......@@ -64,6 +65,7 @@ class CreditApiTestBase(TestCase):
display_name=self.PROVIDER_NAME,
provider_url=self.PROVIDER_URL,
provider_status_url=self.PROVIDER_STATUS_URL,
provider_description=self.PROVIDER_DESCRIPTION,
enable_integration=self.ENABLE_INTEGRATION,
fulfillment_instructions=self.FULFILLMENT_INSTRUCTIONS
)
......@@ -459,6 +461,7 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
"display_name": self.PROVIDER_NAME,
"provider_url": self.PROVIDER_URL,
"provider_status_url": self.PROVIDER_STATUS_URL,
"provider_description": self.PROVIDER_DESCRIPTION,
"enable_integration": self.ENABLE_INTEGRATION,
"fulfillment_instructions": self.FULFILLMENT_INSTRUCTIONS
}
......
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