File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ from .models import PageView
4
+ from .database import info
1
5
from django .test import TestCase
2
6
3
- # Create your tests here.
7
+ # These basic tests are to be used as an example for running tests in S2I
8
+ # and OpenShift when building an application image.
9
+ class PageViewModelTest (TestCase ):
10
+ def test_viewpage_model (self ):
11
+ pageview = PageView .objects .create (hostname = 'localhost' )
12
+ pagetest = PageView .objects .get (hostname = 'localhost' )
13
+ self .assertEqual (pagetest .hostname , 'localhost' )
14
+
15
+ class PageViewTest (TestCase ):
16
+ def test_index (self ):
17
+ resp = self .client .get ('/' )
18
+ self .assertEqual (resp .status_code , 200 )
19
+
20
+ class DbEngine (TestCase ):
21
+ def setUp (self ):
22
+ os .environ ['ENGINE' ] = 'SQLite'
23
+
24
+ def test_engine_setup (self ):
25
+ settings = info ()
26
+ self .assertEqual (settings ['engine' ], 'SQLite' )
27
+ self .assertEqual (settings ['is_sqlite' ], True )
You can’t perform that action at this time.
0 commit comments