Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Commit

Permalink
Remove dependency on newline at end of settings and improve test form…
Browse files Browse the repository at this point in the history
…atting.
  • Loading branch information
Michael Kelly committed Aug 17, 2011
1 parent 911c679 commit 11083ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/__init__.py
Expand Up @@ -70,7 +70,7 @@ def begin(selg):
"'PASSWORD': '%s'" % DB_PASS)
new_st = new_st.replace("'NAME': ''",
"'NAME': '%s'" % DB_NAME)
new_st = new_st + "INSTALLED_APPS = list(INSTALLED_APPS) + " \
new_st = new_st + "\nINSTALLED_APPS = list(INSTALLED_APPS) + " \
"['django.contrib.admin']\n"

with open(st, 'w') as f:
Expand Down
6 changes: 5 additions & 1 deletion tests/test_admin.py
Expand Up @@ -14,6 +14,10 @@


class FakeLoader(BaseLoader):
"""
Gets around TemplateNotFound errors by always returning an empty string as
the template.
"""
is_usable = True

def load_template_source(self, template_name, template_dirs=None):
Expand All @@ -28,5 +32,5 @@ def setUp(self):

def test_login_has_csrf(self):
self.client.get('admin/', follow=True)
assert self.client.cookies.get(ANON_COOKIE) != None, \
assert self.client.cookies.get(ANON_COOKIE), \
"Anonymous CSRF Cookie not set."

0 comments on commit 11083ce

Please sign in to comment.