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='*****@*****.**', )
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, )
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='******')
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
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')
def test_string_method(self): site = SiteFactory(name='MySite') config = SiteConfigFactory(site=site) self.assertEqual(config.__str__(), 'Site configuration for MySite')
def setUp(self): self.site = get_current_site(self.client.request) self.site.config = SiteConfigFactory(site=self.site) self.moderator = factories.ModeratorFactory()
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='******')
def setUp(self): site = get_current_site(self.client.request) site.config = SiteConfigFactory(site=site) self.pending_user = InvitedPendingFactory()