mirror of
https://github.com/django/django.git
synced 2024-12-22 09:05:43 +00:00
Refs #373 -- Fixed CompositePrimaryKey tests if yaml isn't installed.
This commit is contained in:
parent
3d508ececb
commit
28f81a1019
@ -1,7 +1,13 @@
|
|||||||
import json
|
import json
|
||||||
|
import unittest
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
import yaml
|
try:
|
||||||
|
import yaml # NOQA
|
||||||
|
|
||||||
|
HAS_YAML = True
|
||||||
|
except ImportError:
|
||||||
|
HAS_YAML = False
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.core import serializers
|
from django.core import serializers
|
||||||
@ -252,6 +258,7 @@ class CompositePKFixturesTests(TestCase):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@unittest.skipUnless(HAS_YAML, "No yaml library detected")
|
||||||
def test_serialize_user_yaml(self):
|
def test_serialize_user_yaml(self):
|
||||||
users = User.objects.filter(pk=(2, 3))
|
users = User.objects.filter(pk=(2, 3))
|
||||||
result = serializers.serialize("yaml", users)
|
result = serializers.serialize("yaml", users)
|
||||||
|
Loading…
Reference in New Issue
Block a user