-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 changed file
with
16 additions
and
9 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 |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import pytest | ||
from rest_framework import status | ||
|
||
from apps.core.models import Board | ||
from tests.conftest import RequestSetting, TestCase | ||
|
||
|
||
@pytest.mark.usefixtures('set_user_client') | ||
@pytest.mark.usefixtures("set_user_client") | ||
class TestBoard(TestCase, RequestSetting): | ||
|
||
def test_list(self): | ||
Board.objects.create(ko_name='자유 게시판', | ||
en_name='Free Board', | ||
ko_description='자유 게시판 입니다.', | ||
en_description='This is a free board.') | ||
Board.objects.create( | ||
ko_name="자유 게시판", | ||
en_name="Free Board", | ||
ko_description="자유 게시판 입니다.", | ||
en_description="This is a free board.", | ||
) | ||
|
||
boards = self.http_request(self.user, "get", "boards") | ||
|
||
assert boards.status_code == status.HTTP_200_OK | ||
assert len(boards.data) == 1 | ||
|
||
boards = self.http_request(self.user, 'get', 'boards') | ||
(board,) = boards.data | ||
|
||
assert boards.data.get('num_items') == 1 | ||
assert boards.data.get('results')[0].get('en_name') == 'Free Board' | ||
assert board.get("en_name") == "Free Board" |