유닛테스트(QueryDict, 쿼리 스트링 생성)

hyuckhoon.ko·2021년 12월 27일
0
from django.http import QueryDict

ordinary_dict = {'a': 'one', 'b': 'two', }
query_dict = QueryDict('', mutable=True)
query_dict.update(ordinary_dict)


    query_params = {
        "sch": schedule,
        "region": "1",
        "page_size": 300,
        "ordering": "schedule"
    }
    url = f"{EXAMPLE_ENDPOINT}?{urlencode(query_params)}"

https://stackoverflow.com/questions/13363628/django-can-i-create-a-querydict-from-a-dictionary

0개의 댓글