-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #707 from openedx/iahmad/ENT-7554
feat: ENT-7554 Added academies in Algolia index
- Loading branch information
Showing
5 changed files
with
167 additions
and
11 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from uuid import uuid4 | ||
|
||
import factory | ||
from factory.fuzzy import FuzzyText | ||
|
||
from enterprise_catalog.apps.academy.models import Academy, Tag | ||
from enterprise_catalog.apps.catalog.tests.factories import ( | ||
EnterpriseCatalogFactory, | ||
) | ||
|
||
|
||
class TagFactory(factory.django.DjangoModelFactory): | ||
""" | ||
Test factory for the `Tag` model | ||
""" | ||
class Meta: | ||
model = Tag | ||
|
||
|
||
class AcademyFactory(factory.django.DjangoModelFactory): | ||
""" | ||
Test factory for the `Academy` model | ||
""" | ||
class Meta: | ||
model = Academy | ||
|
||
uuid = factory.LazyFunction(uuid4) | ||
title = FuzzyText(length=32) | ||
short_description = FuzzyText(length=32) | ||
long_description = FuzzyText(length=255) | ||
enterprise_catalogs = factory.RelatedFactoryList( | ||
EnterpriseCatalogFactory, | ||
size=4, | ||
) | ||
tags = factory.RelatedFactoryList( | ||
TagFactory, | ||
size=4, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.