micromasters
micromasters copied to clipboard
Refactor Enrollment/Certificate models and tests
#711 introduced the CachedEnrollment and CachedCertificate to our codebase to provide a way for us to cache edx data in our own database. The model definitions are identical, the get_
functions to retrieve their data in dashboard/api.py
are very similar, and the test cases for these models in dashboard/api_test.py
are also very similar. We should be able to abstract a lot of this logic into a parent class that both models inherit from and eliminate this repetition.
UPDATE: PR #720 introduces Factory classes for these two models and some api test cases. Those should also be part of this refactor