-
Notifications
You must be signed in to change notification settings - Fork 485
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
Showing
3 changed files
with
26 additions
and
25 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
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,25 @@ | ||
from django.contrib.auth.models import Group | ||
from django.contrib.sites.models import Site | ||
from django.urls import reverse | ||
|
||
from actstream.tests.test_drf import BaseDRFTestCase | ||
from actstream.drf.serializers import registered_serializers as serializers | ||
from testapp.models import MyUser, Player | ||
from testapp_nested.models.my_model import NestedModel | ||
from testapp.drf import GroupSerializer | ||
|
||
|
||
class DRFTestAppTests(BaseDRFTestCase): | ||
|
||
def test_urls(self): | ||
self._check_urls('actions', 'follows', 'groups', 'sites', | ||
'players', 'nested-models', 'my-users') | ||
|
||
def test_serializers(self): | ||
|
||
models = (Group, MyUser, Player, Site, NestedModel) | ||
self.assertSetEqual(serializers.keys(), models, domap=False) | ||
|
||
groups = self.get(reverse('group-list')) | ||
assert len(groups) == 2 | ||
self.assertSetEqual(GroupSerializer.Meta.fields, groups[0].keys()) |