<s> from django . test import TestCase <EOL> from django . db import models <EOL> from django . contrib . auth import get_user_model <EOL> from django . contrib . sites . models import Site <EOL> from opps . containers . models import ContainerBox <EOL> from opps . channels . models import Channel <EOL> class ContainerBoxTest ( TestCase ) : <EOL> def setUp ( self ) : <EOL> User = get_user_model ( ) <EOL> self . user = User . objects . create ( username = u'<STR_LIT:test>' , password = '<STR_LIT:test>' ) <EOL> self . site = Site . objects . filter ( name = u'<STR_LIT>' ) . get ( ) <EOL> self . channel = Channel . objects . create ( name = u'<STR_LIT>' , slug = u'<STR_LIT>' , <EOL> description = u'<STR_LIT>' , <EOL> site = self . site , user = self . user ) <EOL> def test_create_containerbox ( self ) : <EOL> self . count_container_create = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> ] <EOL> for i in self . count_container_create : <EOL> ContainerBox . objects . create ( title = u'<STR_LIT>' . format ( i ) , <EOL> user = self . user , <EOL> published = True , <EOL> site = self . site , <EOL> channel = self . channel ) <EOL> ContainerBox . objects . create ( title = u'<STR_LIT>' , <EOL> user = self . user , <EOL> published = True , <EOL> site = self . site , <EOL> channel = self . channel ) <EOL> def test_create_and_delete_containersbox ( self ) : <EOL> containerbox = ContainerBox . objects . create ( title = u'<STR_LIT>' , <EOL> slug = u'<STR_LIT>' , <EOL> user = self . user , <EOL> published = True , <EOL> site = self . site , <EOL> channel = self . channel , <EOL> channel_long_slug = self . channel . long_slug ) <EOL> containerbox . delete ( ) <EOL> def test_edit_containersbox ( self ) : <EOL> containerbox = ContainerBox . objects . create ( title = u'<STR_LIT>' , <EOL> slug = u'<STR_LIT>' , <EOL> user = self . user , <EOL> published = True , <EOL> site = self . site , <EOL> channel = self . channel , <EOL> channel_long_slug = self . channel . long_slug ) <EOL> containerbox . title = u'<STR_LIT>' <EOL> containerbox . save ( ) </s>
