def test_approve(self): """Test approving a join request""" join_request = JoinRequest(user=self.systers_user, community=self.community) self.assertFalse(join_request.is_approved) join_request.approve() self.assertTrue(join_request.is_approved) join_request.approve() self.assertTrue(join_request.is_approved)
def test_unicode(self): """Test JoinRequest object string representation""" join_request = JoinRequest(user=self.systers_user, community=self.community) self.assertEqual(str(join_request), "Join Request by foo - not approved") join_request.is_approved = True join_request.save() self.assertEqual(str(join_request), "Join Request by foo - approved")