Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
software-dev-7054cem/Test/test_userfactory.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17 lines (13 sloc)
478 Bytes
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
import unittest | |
from userfactory import UserFactory | |
class TestUserFactory(unittest.TestCase): | |
def setUp(self): | |
self.__factory = UserFactory() | |
def test_factory_creates_staff(self): | |
staff = self.__factory.factory("staff") | |
role = staff.get_role() | |
self.assertEqual(role, "staff") | |
def test_factory_creates_user(self): | |
staff = self.__factory.factory("user") | |
role = staff.get_role() | |
self.assertEqual(role, "user") |