Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
1d2bc6fd
Commit
1d2bc6fd
authored
Jul 27, 2015
by
Awais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ECOM-1807 Adding provider thumbnail url.
parent
0f94910d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
openedx/core/djangoapps/credit/api/provider.py
+3
-1
openedx/core/djangoapps/credit/migrations/0017_auto__add_field_creditprovider_thumbnail_url.py
+0
-0
openedx/core/djangoapps/credit/models.py
+9
-0
openedx/core/djangoapps/credit/tests/test_api.py
+7
-2
No files found.
openedx/core/djangoapps/credit/api/provider.py
View file @
1d2bc6fd
...
...
@@ -87,6 +87,7 @@ def get_credit_provider_info(request, provider_id): # pylint: disable=unused-ar
<li>Sample instruction abc</li>
<li>Sample instruction xyz</li>
</ul>",
"thumbnail_url": "https://credit.example.com/logo.png"
}
"""
...
...
@@ -100,7 +101,8 @@ def get_credit_provider_info(request, provider_id): # pylint: disable=unused-ar
"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
"fulfillment_instructions"
:
credit_provider
.
fulfillment_instructions
,
"thumbnail_url"
:
credit_provider
.
thumbnail_url
}
return
JsonResponse
(
credit_provider_data
)
...
...
openedx/core/djangoapps/credit/migrations/0017_auto__add_field_creditprovider_thumbnail_url.py
0 → 100644
View file @
1d2bc6fd
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/credit/models.py
View file @
1d2bc6fd
...
...
@@ -129,6 +129,14 @@ class CreditProvider(TimeStampedModel):
)
)
thumbnail_url
=
models
.
URLField
(
default
=
""
,
max_length
=
255
,
help_text
=
ugettext_lazy
(
"Thumbnail image url of the credit provider."
)
)
CREDIT_PROVIDERS_CACHE_KEY
=
"credit.providers.list"
@classmethod
...
...
@@ -166,6 +174,7 @@ class CreditProvider(TimeStampedModel):
"description"
:
provider
.
provider_description
,
"enable_integration"
:
provider
.
enable_integration
,
"fulfillment_instructions"
:
provider
.
fulfillment_instructions
,
"thumbnail_url"
:
provider
.
thumbnail_url
,
}
for
provider
in
credit_providers
]
...
...
openedx/core/djangoapps/credit/tests/test_api.py
View file @
1d2bc6fd
...
...
@@ -70,6 +70,7 @@ class CreditApiTestBase(ModuleStoreTestCase):
"mailing_address"
:
"123 Fake Street, Cambridge MA"
,
"country"
:
"US"
,
}
THUMBNAIL_URL
=
"https://credit.example.com/logo.png"
def
setUp
(
self
,
**
kwargs
):
super
(
CreditApiTestBase
,
self
)
.
setUp
()
...
...
@@ -86,7 +87,8 @@ class CreditApiTestBase(ModuleStoreTestCase):
provider_status_url
=
self
.
PROVIDER_STATUS_URL
,
provider_description
=
self
.
PROVIDER_DESCRIPTION
,
enable_integration
=
self
.
ENABLE_INTEGRATION
,
fulfillment_instructions
=
self
.
FULFILLMENT_INSTRUCTIONS
fulfillment_instructions
=
self
.
FULFILLMENT_INSTRUCTIONS
,
thumbnail_url
=
self
.
THUMBNAIL_URL
)
return
credit_course
...
...
@@ -516,7 +518,8 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
"status_url"
:
self
.
PROVIDER_STATUS_URL
,
"description"
:
self
.
PROVIDER_DESCRIPTION
,
"enable_integration"
:
self
.
ENABLE_INTEGRATION
,
"fulfillment_instructions"
:
self
.
FULFILLMENT_INSTRUCTIONS
"fulfillment_instructions"
:
self
.
FULFILLMENT_INSTRUCTIONS
,
"thumbnail_url"
:
self
.
THUMBNAIL_URL
}
])
...
...
@@ -540,6 +543,7 @@ class CreditProviderIntegrationApiTests(CreditApiTestBase):
"description"
:
self
.
PROVIDER_DESCRIPTION
,
"enable_integration"
:
self
.
ENABLE_INTEGRATION
,
"fulfillment_instructions"
:
self
.
FULFILLMENT_INSTRUCTIONS
,
"thumbnail_url"
:
self
.
THUMBNAIL_URL
}]
result
=
api
.
get_credit_providers
([
self
.
PROVIDER_ID
])
self
.
assertEqual
(
result
,
expected_result
)
...
...
@@ -838,6 +842,7 @@ class CreditApiFeatureFlagEnabledTests(CreditApiFeatureFlagTest, CreditApiTestBa
"provider_description"
:
self
.
PROVIDER_DESCRIPTION
,
"enable_integration"
:
self
.
ENABLE_INTEGRATION
,
"fulfillment_instructions"
:
self
.
FULFILLMENT_INSTRUCTIONS
,
"thumbnail_url"
:
self
.
THUMBNAIL_URL
}
path
=
reverse
(
'credit:get_provider_info'
,
kwargs
=
{
'provider_id'
:
self
.
PROVIDER_ID
})
result
=
self
.
client
.
get
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment