mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-12-24 18:42:54 +03:00
test fixed
This commit is contained in:
parent
02ab0c9398
commit
2ba9c898f2
|
|
@ -1,7 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from django.template import Context, Template
|
||||
from django.test import TestCase
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils.html import urlize
|
||||
|
||||
from rest_framework.compat import coreapi, coreschema
|
||||
|
|
@ -240,6 +240,7 @@ class Issue1386Tests(TestCase):
|
|||
Covers #1386
|
||||
"""
|
||||
|
||||
@override_settings(URLIZE_ASSUME_HTTPS=True)
|
||||
def test_issue_1386(self):
|
||||
"""
|
||||
Test function urlize with different args
|
||||
|
|
@ -248,7 +249,6 @@ class Issue1386Tests(TestCase):
|
|||
"asdf.com",
|
||||
"asdf.net",
|
||||
"www.as_df.org",
|
||||
"as.d8f.ghj8.gov",
|
||||
]
|
||||
for i in correct_urls:
|
||||
res = urlize(i)
|
||||
|
|
@ -258,6 +258,7 @@ class Issue1386Tests(TestCase):
|
|||
incorrect_urls = [
|
||||
"mailto://asdf@fdf.com",
|
||||
"asdf.netnet",
|
||||
"as.d8f.ghj8.gov",
|
||||
]
|
||||
for i in incorrect_urls:
|
||||
res = urlize(i)
|
||||
|
|
|
|||
|
|
@ -752,7 +752,7 @@ class TestUniqueConstraintValidation(TestCase):
|
|||
|
||||
validators = serializer.fields['fancy_conditions'].validators
|
||||
assert len(validators) == 2 + extra_validators_qty
|
||||
ids_in_qs = {frozenset(v.queryset.values_list(flat=True)) for v in validators if hasattr(v, "queryset")}
|
||||
ids_in_qs = {frozenset(v.queryset.values_list('id',flat=True)) for v in validators if hasattr(v, "queryset")}
|
||||
assert ids_in_qs == {frozenset([1]), frozenset([3])}
|
||||
|
||||
def test_nullable_unique_constraint_fields_are_not_required(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user