This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #27546 -- Tested some __repr__() methods.
- Loading branch information
Showing
5 changed files
with
36 additions
and
0 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ answer newbie questions, and generally made Django that much better: | |
Adam Johnson <https://github.com/adamchainz> | ||
Adam Malinowski <http://adammalinowski.co.uk> | ||
Adam Vandenberg | ||
Adiyat Mubarak <[email protected]> | ||
Adrian Holovaty <[email protected]> | ||
Adrien Lemaire <[email protected]> | ||
Afonso Fernández Nogueira <[email protected]> | ||
|
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,13 @@ | ||
import os | ||
|
||
from django.core.management.commands.makemessages import TranslatableFile | ||
from django.test import SimpleTestCase | ||
|
||
|
||
class TranslatableFileTests(SimpleTestCase): | ||
|
||
def test_repr(self): | ||
dirpath = 'dir' | ||
file_name = 'example' | ||
trans_file = TranslatableFile(dirpath=dirpath, file_name=file_name, locale_dir=None) | ||
self.assertEqual(repr(trans_file), '<TranslatableFile: %s>' % os.path.join(dirpath, file_name)) |
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,12 @@ | ||
from django.core.serializers.base import DeserializedObject | ||
from django.test import SimpleTestCase | ||
|
||
from .models import Author | ||
|
||
|
||
class TestDeserializedObjectTests(SimpleTestCase): | ||
|
||
def test_repr(self): | ||
author = Author(name='John', pk=1) | ||
deserial_obj = DeserializedObject(obj=author) | ||
self.assertEqual(repr(deserial_obj), '<DeserializedObject: serializers.Author(pk=1)>') |
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