示例#1
0
class LocationLocationTest(TestCase):
    def setUp(self):
        # create the objects needed
        self.client = Client()
        self.location = Location()

        self.user = User(username="******")
        self.user.set_password("google")
        self.user.is_active = True
        self.user.save()

    def tearDown(self):
        self.client = None
        self.location = None
        self.user = None

    def test_save(self):
        self.location.location_name = "Unit Testing"
        self.location.description = "Unit Testing"

        # required fields
        self.location.creator = self.user
        self.location.creator_username = self.user.username
        self.location.owner = self.user
        self.location.owner_username = self.user.username
        self.location.status = True
        self.location.status_detail = "active"
        self.location.enclosure_length = 0
        self.location.timezone = "America/Chicago"

        self.location.save()

        self.assertEquals(type(self.location.id), long)
示例#2
0
文件: tests.py 项目: kgayle/tendenci
class LocationLocationTest(TestCase):
    def setUp(self):
        # create the objects needed
        self.client = Client()
        self.location = Location()

        self.user = User(username='******')
        self.user.set_password('google')
        self.user.is_active = True
        self.user.save()

    def tearDown(self):
        self.client = None
        self.location = None
        self.user = None

    def test_save(self):
        self.location.location_name = 'Unit Testing'
        self.location.description = 'Unit Testing'

        # required fields
        self.location.creator = self.user
        self.location.creator_username = self.user.username
        self.location.owner = self.user
        self.location.owner_username = self.user.username
        self.location.status = True
        self.location.status_detail = 'active'
        self.location.enclosure_length = 0
        self.location.timezone = 'America/Chicago'

        self.location.save()

        self.assertEquals(type(self.location.id), long)
示例#3
0
文件: tests.py 项目: kgayle/tendenci
    def setUp(self):
        # create the objects needed
        self.client = Client()
        self.location = Location()

        self.user = User(username='******')
        self.user.set_password('google')
        self.user.is_active = True
        self.user.save()
示例#4
0
    def setUp(self):
        # create the objects needed
        self.client = Client()
        self.location = Location()

        self.user = User(username="******")
        self.user.set_password("google")
        self.user.is_active = True
        self.user.save()