4 |
4 |
5 Replace these with more appropriate tests for your application. |
5 Replace these with more appropriate tests for your application. |
6 """ |
6 """ |
7 |
7 |
8 from django.conf import settings |
8 from django.conf import settings |
|
9 from django.contrib.auth import get_user_model, create_superuser |
9 from django.utils._os import WindowsError |
10 from django.utils._os import WindowsError |
10 from ldt.ldt_utils.models import User, Content, Media |
11 from ldt.ldt_utils.models import Content, Media |
11 from ldt.test.client import Client |
12 from ldt.test.client import Client |
12 from ldt.test.testcases import TestCase |
13 from ldt.test.testcases import TestCase |
13 import logging |
14 import logging |
14 import os |
15 import os |
|
16 |
|
17 User = get_user_model() |
15 |
18 |
16 class ContentTest(TestCase): |
19 class ContentTest(TestCase): |
17 |
20 |
18 fixtures = ['base_data.json', 'user_data.json'] |
21 fixtures = ['base_data.json', 'user_data.json'] |
19 |
22 |
20 def setUp(self): |
23 def setUp(self): |
21 self.client = Client() |
24 self.client = Client() |
22 User.objects.create_superuser('blop', 'blop@blop.com', 'blop') |
25 create_superuser('blop', 'blop@blop.com', 'blop') |
23 |
26 |
24 _ = self.client.login(username='blop', password='blop') |
27 _ = self.client.login(username='blop', password='blop') |
25 |
28 |
26 self.user = User() |
29 self.user = User() |
27 self.user.username = 'blop' |
30 self.user.username = 'blop' |