Beispiel #1
0
    def setUp(self):
        site = get_current_site(self.client.request)
        site.config = SiteConfigFactory(site=site)

        self.closed_user = UserFactory(
            email='*****@*****.**',
            is_closed=True,
        )
        self.existing_user = UserFactory(email='*****@*****.**', )
Beispiel #2
0
 def setUp(self):
     self.standard_user = UserFactory(email='*****@*****.**')
     self.factory = RequestFactory()
     self.site = get_current_site(self.client.request)
     self.site.config = SiteConfigFactory(site=self.site)
     self.closed_user = UserFactory(
         full_name='Closed',
         email='*****@*****.**',
         is_closed=True,
     )
Beispiel #3
0
    def setUp(self):
        site = get_current_site(self.client.request)
        site.config = SiteConfigFactory(site=site)

        self.standard_user = UserFactory()

        # Setup skills
        self.django = SkillFactory(name='django')
        self.rails = SkillFactory(name='rails')
        self.jquery = SkillFactory(name='jquery')

        self.client.login(username=self.standard_user.email, password='******')
Beispiel #4
0
    def test_can_send_connect_email(self):
        subject = 'Test email'
        template = 'emails/email_base.html'
        recipient = UserFactory(email='*****@*****.**')
        site = SiteFactory(domain='mydomain.com')
        site.config = SiteConfigFactory(site=site)

        # Sender != from email, but rather the user who has sent the message
        sender = UserFactory(email='*****@*****.**')
        url = 'http://testurl.com'
        comments = 'comment',
        logged_against = UserFactory(email='*****@*****.**')

        email = send_connect_email(subject, template, recipient, site, sender,
                                   url, comments, logged_against)

        self.assertEqual(email, 1) # send_email returns no. of emails sent
Beispiel #5
0
def before_scenario(context, scenario):

    # Reset the database before each scenario
    management.call_command('flush', verbosity=0, interactive=False)

    # Then recreate our base data
    site = Site.objects.get(domain='example.com')

    try:
        site_config = SiteConfig.objects.get(site=site)
    except ObjectDoesNotExist:
        site_config = SiteConfigFactory(site=site)

    # Setup skills
    SkillFactory(name='skill1')
    SkillFactory(name='skill2')

    # Setup roles
    RoleFactory(name='role1')
    RoleFactory(name='role2')
    RoleFactory(name='role3')
Beispiel #6
0
    def test_string_method(self):
        site = SiteFactory(name='MySite')
        config = SiteConfigFactory(site=site)

        self.assertEqual(config.__str__(), 'Site configuration for MySite')
Beispiel #7
0
 def setUp(self):
     self.site = get_current_site(self.client.request)
     self.site.config = SiteConfigFactory(site=self.site)
     self.moderator = factories.ModeratorFactory()
Beispiel #8
0
    def setUp(self):
        site = get_current_site(self.client.request)
        site.config = SiteConfigFactory(site=site)

        self.standard_user = UserFactory()
        self.client.login(username=self.standard_user.email, password='******')
Beispiel #9
0
    def setUp(self):
        site = get_current_site(self.client.request)
        site.config = SiteConfigFactory(site=site)

        self.pending_user = InvitedPendingFactory()
Beispiel #10
0
    def test_string_method(self):
        site = SiteFactory(name='MySite')
        config = SiteConfigFactory(site=site)

        self.assertEqual(config.__str__(), 'Site configuration for MySite')