my_repo_dir = '/home/alisic/repos/'
my_backup_dir = my_repo_dir + 'backups/'
- """ A test case for testing project related stuff """
+ """A base test case class for hgfront testing. Test cases should extend this class.
+ `fixtures` is a list of fixtures to be used as data. `username` and `password` are
+ the username and password that are to be used when testing sites as if you were logged in.
+ A User with the username and password that are provided should exist in the fixtures given.
+ If anonymous is set to False, setUp will log in the client before doing any tests. If it's
+ set to True, it will perform the tests as an anonymous user"""
+ username = 'test_admin'
+ password = 'test_admin'
- self.client.login(username='test_admin', password='test_admin')
+ The set up here makes the test use the repository and backup directory specified
+ in the module. Once I find out how to switch databases on the fly to pull it out
+ from the main database instead of the one that's created temporarily for tests,
+ you won't have to specify my_repo_dir and my_backup_dir in the module.
+ This set up also checks if anonymous is set to True or False and logs the user
repo_dir_setting = Setting.objects.get(attribute_name=u'repository_directory')
repo_backup_setting = Setting.objects.get(attribute_name=u'backups_directory')
repo_dir_setting.value = my_repo_dir
repo_backup_setting.value = my_backup_dir
+ self.client.login(username=self.username, password=self.password)
+ """ A test case for testing project related stuff """
response = self.client.get(reverse('project-list'))
""" This is like the ProjectTestCase test case only it does the testing
with an anonymous user, whereas ProjectTestCase does the tests with a
- super(self.__class__, self).setUp()