-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e69505a
commit c525774
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
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,26 @@ | ||
import json | ||
|
||
from django.test import TestCase | ||
from wagtail.test.utils import WagtailPageTests | ||
from oxmenus.models import Menus | ||
|
||
|
||
class OXMenuTests(WagtailPageTests, TestCase): | ||
def setUp(self): | ||
oxmenu = Menus(name="What we do", | ||
menu=json.dumps( | ||
[{"id": "07d57c52-5ec0-494e-870f-3e8b6c86aebc", "type": "menu_block", "value": { | ||
"menu_items": [{"id": "c2793dd0-d0d2-4835-ad1a-3431fd435604", "type": "item", | ||
"value": {"label": "About Us", "partial_url": "/about"}}, | ||
{"id": "7d5e6a0d-8034-43c5-89b6-2de10f534034", "type": "item", | ||
"value": {"label": "Team", "partial_url": "/team"}}, | ||
{"id": "a402ea4e-cef1-4257-adce-cc4cd1be7f5e", "type": "item", | ||
"value": {"label": "Research", "partial_url": "/research"}}]}}] | ||
) | ||
) | ||
oxmenu.save() | ||
|
||
def test_all_menus(self): | ||
response = self.client.get('/apps/cms/api/oxmenus/') | ||
self.assertContains(response, 'About Us') | ||
self.assertContains(response, 'Research') |