forked from eee555/saolei_website
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eee555#173 from putianyi889/patch-94
解决bvs的除0错误
- Loading branch information
Showing
3 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
from django.test import TestCase | ||
from userprofile.models import UserProfile | ||
from .models import VideoModel, ExpandVideoModel | ||
|
||
# Create your tests here. | ||
|
||
class VideoManagerTestCase(TestCase): | ||
def setUp(self): | ||
self.user = UserProfile.objects.create(username='setUp', email='[email protected]') | ||
|
||
def test_zero_time(self): | ||
expandvideo = ExpandVideoModel.objects.create(identifier='test', left=1, right=0, double=0, cl=1, left_s=0, right_s=0, double_s=0, cl_s=0, path=0, flag=0, flag_s=0, stnb=0, rqp=0, ioe=1, thrp=1, corr=1, ce=1, ce_s=0, op=1, isl=0, cell0=0, cell1=0, cell2=0, cell3=0, cell4=0, cell5=0, cell6=0, cell7=0, cell8=0) | ||
video = VideoModel.objects.create(player=self.user, file='test.evf', video=expandvideo, state='a', software='e', level='b', mode='00', timems=0, bv=1) | ||
self.assertEqual(video.bvs, 0) |