From a972f8d4f186128425fe13aa30a117707557fe88 Mon Sep 17 00:00:00 2001 From: ailsoncgt Date: Sun, 20 Nov 2016 22:25:26 -0300 Subject: [PATCH] Changes in topic model #128 #129 #130 --- files/tests.py | 3 --- files/tests/files/teste.png | Bin 0 -> 11808 bytes files/tests/files/update.png | Bin 0 -> 42003 bytes files/tests/tests.py | 8 +++++--- 4 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 files/tests.py create mode 100644 files/tests/files/teste.png create mode 100644 files/tests/files/update.png diff --git a/files/tests.py b/files/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/files/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/files/tests/files/teste.png b/files/tests/files/teste.png new file mode 100644 index 0000000..8b04181 Binary files /dev/null and b/files/tests/files/teste.png differ diff --git a/files/tests/files/update.png b/files/tests/files/update.png new file mode 100644 index 0000000..dc4c77b Binary files /dev/null and b/files/tests/files/update.png differ diff --git a/files/tests/tests.py b/files/tests/tests.py index 1cdd55f..a6748fe 100644 --- a/files/tests/tests.py +++ b/files/tests/tests.py @@ -9,6 +9,9 @@ from files.models import TopicFile from files.forms import FileForm, UpdateFileForm from courses.models import CourseCategory, Course, Subject, Topic +import os +FILE_DIR = os.path.dirname(os.path.abspath(__file__)) + class FileTestCase(TestCase): def setUp(self): @@ -77,7 +80,6 @@ class FileTestCase(TestCase): name = 'Topic Test', description = "description of the topic test file", subject = self.subject, - owner = self.teacher, ) self.topic.save() @@ -85,7 +87,7 @@ class FileTestCase(TestCase): Manual upload file Change directory for a file in your computer and be happy... """ - upload_file = open('/home/ailson/Pictures/teste.png', 'rb') + upload_file = open( '/'.join([FILE_DIR, 'files/teste.png']), 'rb') self.file = SimpleUploadedFile(upload_file.name, upload_file.read()) def test_create_file_ok(self): @@ -134,7 +136,7 @@ class FileTestCase(TestCase): url = reverse('course:file:update_file',kwargs={'slug': self.file_update.slug}) - upload_file_update = open('/home/ailson/Pictures/update.png', 'rb') + upload_file_update = open( '/'.join([FILE_DIR, 'files/update.png']), 'rb') new_file = SimpleUploadedFile(upload_file_update.name, upload_file_update.read()) data = { 'name' : 'updated', -- libgit2 0.21.2