1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-15 05:33:38 +00:00

[tests] Fix shared file tests

This commit is contained in:
zhengxie 2015-05-27 14:32:44 +08:00
parent 6cbd42e015
commit 81d72ed599

View File

@ -52,7 +52,7 @@ class FileViaSharedDirTest(TestCase, Fixtures):
'password': None, 'password': None,
'expire_date': None, 'expire_date': None,
} }
self.fs = FileShare.objects.create_file_link(**share_file_info) self.fs = FileShare.objects.create_dir_link(**share_file_info)
def tearDown(self): def tearDown(self):
self.remove_repo() self.remove_repo()
@ -105,10 +105,10 @@ class PrivateSharedFileTest(TestCase, Fixtures):
) )
self.assertEqual(200, resp.status_code) self.assertEqual(200, resp.status_code)
self.assertTemplateUsed(resp, 'shared_file_view.html') self.assertTemplateUsed(resp, 'shared_file_view.html')
self.assertContains(resp, self.file) self.assertContains(resp, os.path.basename(self.file))
dl_url_param = '?p=%s&dl=1' % self.file dl_url_tag = '<a href="?dl=1" class="obv-btn">'
self.assertContains(resp, dl_url_param) self.assertContains(resp, dl_url_tag)
def test_can_download(self): def test_can_download(self):
self.client.post( self.client.post(