Commit 1e380815 by zubair-arbi

Merge pull request #8846 from edx/zub/story/add-credit-provider-description

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