﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18926	Django test suite doesn't pass on Windows when checked out of git	dlanger	nobody	"There are several tests in the Django test suite that are line-ending dependent - for example, `regressiontests.admin_views.tests.AdminSearchTest`, which asserts the presence of `\n1 user\n` (as well as a few others that have `\n` in their assertions). These test pass in environments that use LF as their default line ending.

Running Windows, `git`'s default behaviour is to change LF line endings to CRLF when a file is loaded from the object database, and convert them back to LF when they're committed. This causes those tests to fail, since `\n1 user\n` isn't there - `\r\n1 user\r\n` is. 

This can be fixed by adding a `.gitattributes` file to the root of the Django repo, which tells git clients how to handle those files. The one attached is minimal - it says to treat all HTML files as text, and to keep the line endings as LF for those files. See [http://timclem.wordpress.com/2012/03/01/mind-the-end-of-your-line/ here] for a post on cross-platform line endings and git, and the format of the `.gitattributes` file.

To reproduce, '''check out''' the root Django repo into a Windows environment using standard Windows git (eg. from [https://help.github.com/articles/set-up-git#platform-windows GitHub]) - downloading and extracting a tarball won't do the bad line-ending conversion - and run `python runtests.py --settings=test_sqlite admin_views`. 

Tested on Windows7 x64, git 1.7.11, and HEAD of `django:master`."	Bug	closed	Uncategorized	1.4	Normal	duplicate		Jannis Leidel	Unreviewed	1	0	0	0	0	0
