def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**' } self.user_test = User(**userdata) self.user_test.save() teamhierarchydata = { 'code': 'SomeValue', 'description': 'Description of TeamHierarchy', 'parentNode': None, 'site': Site() } self.teamHierarchy = TeamHierarchy(**teamhierarchydata) self.teamHierarchy.save() usersharedata = { 'user': self.user_test, 'userTeam': self.teamHierarchy } self.userShare = UserShare(**usersharedata) self.userShare.save()
def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**', } self.user_test = User(**userdata) self.user_test.save() entry = User.objects.get(id=self.user_test.id) self.userProfile = UserProfile.objects.get(id=entry.id)
def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**', } self.user_test = User(**userdata) self.user_test.save() entry = User.objects.get(id = self.user_test.id) self.userProfile = UserProfile.objects.get(id = entry.id)
class UserShareTest(TestCase): def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**' } self.user_test = User(**userdata) self.user_test.save() teamhierarchydata = { 'code': 'SomeValue', 'description': 'Description of TeamHierarchy', 'parentNode': None, 'site': Site() } self.teamHierarchy = TeamHierarchy(**teamhierarchydata) self.teamHierarchy.save() usersharedata = { 'user': self.user_test, 'userTeam': self.teamHierarchy } self.userShare = UserShare(**usersharedata) self.userShare.save() def tearDown(self): self.userShare.delete() self.teamHierarchy.delete() self.user_test.delete() def test_verifying_string_representation(self): self.assertEqual( self.userShare.user.username + '-' + self.userShare.userTeam.code, str(self.userShare))
class UserShareTest(TestCase): def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**' } self.user_test = User(**userdata) self.user_test.save() teamhierarchydata = { 'code': 'SomeValue', 'description': 'Description of TeamHierarchy', 'parentNode': None, 'site': Site() } self.teamHierarchy = TeamHierarchy(**teamhierarchydata) self.teamHierarchy.save() usersharedata = { 'user': self.user_test, 'userTeam': self.teamHierarchy } self.userShare = UserShare(**usersharedata) self.userShare.save() def tearDown(self): self.userShare.delete() self.teamHierarchy.delete() self.user_test.delete() def test_verifying_string_representation(self): self.assertEqual(self.userShare.user.username + '-' + self.userShare.userTeam.code, str(self.userShare))
class UserProfileTest(TestCase): def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**', } self.user_test = User(**userdata) self.user_test.save() entry = User.objects.get(id = self.user_test.id) self.userProfile = UserProfile.objects.get(id = entry.id) def tearDown(self): self.user_test.delete() self.userProfile.delete() def test_user_post_save(self): self.assertIsNotNone(self.userProfile) def test_verifying_string_representation(self): self.assertEqual(self.userProfile.user.username, str(self.user_test))
class UserProfileTest(TestCase): def setUp(self): userdata = { 'username': '******', 'first_name': 'Bob', 'last_name': 'Tremblay', 'email': '*****@*****.**', } self.user_test = User(**userdata) self.user_test.save() entry = User.objects.get(id=self.user_test.id) self.userProfile = UserProfile.objects.get(id=entry.id) def tearDown(self): self.user_test.delete() self.userProfile.delete() def test_user_post_save(self): self.assertIsNotNone(self.userProfile) def test_verifying_string_representation(self): self.assertEqual(self.userProfile.user.username, str(self.user_test))