~cr3/launchpad-results/trunk

« back to all changes in this revision

Viewing changes to launchpadresults/models/tests/test_person.py

  • Committer: Marc Tardif
  • Date: 2010-09-23 23:40:07 UTC
  • Revision ID: marc.tardif@canonical.com-20100923234007-kxouzhvgv613957k
Added testing layers and factories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
from unittest import defaultTestLoader
 
5
 
 
6
from launchpadresults.testing.cases import TestCaseWithFactory
 
7
from launchpadresults.testing.layers import FunctionalDatabaseLayer
 
8
 
 
9
 
 
10
 
 
11
class TestPerson(TestCaseWithFactory):
 
12
 
 
13
    layer = FunctionalDatabaseLayer
 
14
 
 
15
    def test_makePerson(self):
 
16
        person = self.factory.makePerson(u"me", u"123")
 
17
        self.assertNotEquals(person, None)
 
18
        self.assertEquals(person.name, u"me")
 
19
        self.assertEquals(person.identity, u"123")
 
20
 
 
21
 
 
22
def test_suite():
 
23
    return defaultTestLoader.loadTestsFromName(__name__)