From 0a5ca000edcd8fba1e5e5f71c7267d9f52e456a0 Mon Sep 17 00:00:00 2001 From: Ben Timby Date: Wed, 18 Jan 2012 22:59:30 -0500 Subject: Docstring/whitespace fixes. --- djangorestframework/tests/accept.py | 3 -- djangorestframework/tests/files.py | 4 --- djangorestframework/tests/models.py | 56 ++++++++++++++++++------------------ djangorestframework/tests/parsers.py | 1 - 4 files changed, 28 insertions(+), 36 deletions(-) (limited to 'djangorestframework/tests') diff --git a/djangorestframework/tests/accept.py b/djangorestframework/tests/accept.py index 4f9dbb32..d66f6fb0 100644 --- a/djangorestframework/tests/accept.py +++ b/djangorestframework/tests/accept.py @@ -63,6 +63,3 @@ class UserAgentMungingTest(TestCase): resp = self.view(req) self.assertEqual(resp['Content-Type'], 'application/json') - - - diff --git a/djangorestframework/tests/files.py b/djangorestframework/tests/files.py index 91f46061..d3b1cc56 100644 --- a/djangorestframework/tests/files.py +++ b/djangorestframework/tests/files.py @@ -30,7 +30,3 @@ class UploadFilesTests(TestCase): response = view(request) self.assertEquals(response.content, '{"FILE_CONTENT": "stuff", "FILE_NAME": "stuff.txt"}') - - - - diff --git a/djangorestframework/tests/models.py b/djangorestframework/tests/models.py index 39ac59e7..4cae68b6 100644 --- a/djangorestframework/tests/models.py +++ b/djangorestframework/tests/models.py @@ -1,28 +1,28 @@ -from django.db import models -from django.contrib.auth.models import Group - -class CustomUser(models.Model): - """ - A custom user model, which uses a 'through' table for the foreign key - """ - username = models.CharField(max_length=255, unique=True) - groups = models.ManyToManyField( - to=Group, blank=True, null=True, through='UserGroupMap' - ) - - @models.permalink - def get_absolute_url(self): - return ('custom_user', (), { - 'pk': self.id - }) - - -class UserGroupMap(models.Model): - user = models.ForeignKey(to=CustomUser) - group = models.ForeignKey(to=Group) - - @models.permalink - def get_absolute_url(self): - return ('user_group_map', (), { - 'pk': self.id - }) +from django.db import models +from django.contrib.auth.models import Group + +class CustomUser(models.Model): + """ + A custom user model, which uses a 'through' table for the foreign key + """ + username = models.CharField(max_length=255, unique=True) + groups = models.ManyToManyField( + to=Group, blank=True, null=True, through='UserGroupMap' + ) + + @models.permalink + def get_absolute_url(self): + return ('custom_user', (), { + 'pk': self.id + }) + + +class UserGroupMap(models.Model): + user = models.ForeignKey(to=CustomUser) + group = models.ForeignKey(to=Group) + + @models.permalink + def get_absolute_url(self): + return ('user_group_map', (), { + 'pk': self.id + }) diff --git a/djangorestframework/tests/parsers.py b/djangorestframework/tests/parsers.py index 5bd4aad3..1ecc1760 100644 --- a/djangorestframework/tests/parsers.py +++ b/djangorestframework/tests/parsers.py @@ -172,7 +172,6 @@ class TestXMLParser(TestCase): 'field_b': 'dasd', 'field_c': None, 'field_d': datetime.datetime(2011, 12, 25, 12, 45, 00) - } self._complex_data_input = StringIO( '' -- cgit v1.2.3