Example #1
0
    def test_edit_finding_looking_for_work(self):
        url_edit_finding = reverse("edit_finding", args=["daveb"])
        url_profile = reverse("user_profile", args=["daveb"])

        new_email = "*****@*****.**"
        looking_for_work = "freelance"
        data = {
            "looking_for_work": looking_for_work,
            "email": new_email,
            "first_name": "Hello",
            "last_name": "World",
            "privacy_search": "public",
            "privacy_email": "private",
            "privacy_im": "private",
            "privacy_irctrack": "public",
        }

        p = DjangoPerson.objects.get(user__username="******")
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags["profile"]["looking_for_work"], "full-time")

        response = self.client.post(url_edit_finding, data, follow=True)
        self.assertRedirects(response, url_profile)

        p = DjangoPerson.objects.get(user__username="******")
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags["profile"]["looking_for_work"], "freelance")

        # check initial value
        response = self.client.get(url_edit_finding)
        self.assertContains(response, looking_for_work)
Example #2
0
    def test_edit_finding_looking_for_work(self):
        url_edit_finding = reverse('edit_finding', args=['daveb'])
        url_profile = reverse('user_profile', args=['daveb'])

        new_email = '*****@*****.**'
        looking_for_work = 'freelance'
        data = {
            'looking_for_work': looking_for_work,
            'email': new_email,
            'first_name': 'Hello',
            'last_name': 'World',
            'privacy_search': 'public',
            'privacy_email': 'private',
            'privacy_im': 'private',
            'privacy_irctrack': 'public'
        }

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['profile']['looking_for_work'], 'full-time')

        response = self.client.post(url_edit_finding, data, follow=True)
        self.assertRedirects(response, url_profile)

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['profile']['looking_for_work'], 'freelance')

        # check initial value
        response = self.client.get(url_edit_finding)
        self.assertContains(response, looking_for_work)
Example #3
0
    def test_edit_finding_services(self):
        url_edit_finding = reverse('edit_finding', args=['daveb'])
        url_profile = reverse('user_profile', args=['daveb'])

        service_twitter = 'https://twitter.com/davebbar'
        data = {
            'service_twitter': service_twitter,
            'email': '*****@*****.**',
            'first_name': 'Hello',
            'last_name': 'World',
            'privacy_search': 'public',
            'privacy_email': 'private',
            'privacy_im': 'private',
            'privacy_irctrack': 'public'
        }

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['services']['twitter'], '')

        response = self.client.post(url_edit_finding, data, follow=True)
        self.assertRedirects(response, url_profile)

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['services']['twitter'], service_twitter)

        # check initial value
        response = self.client.get(url_edit_finding)
        self.assertContains(response, service_twitter)
Example #4
0
    def test_edit_finding_services(self):
        url_edit_finding = reverse("edit_finding", args=["daveb"])
        url_profile = reverse("user_profile", args=["daveb"])

        service_twitter = "https://twitter.com/davebbar"
        data = {
            "service_twitter": service_twitter,
            "email": "*****@*****.**",
            "first_name": "Hello",
            "last_name": "World",
            "privacy_search": "public",
            "privacy_email": "private",
            "privacy_im": "private",
            "privacy_irctrack": "public",
        }

        p = DjangoPerson.objects.get(user__username="******")
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags["services"]["twitter"], "")

        response = self.client.post(url_edit_finding, data, follow=True)
        self.assertRedirects(response, url_profile)

        p = DjangoPerson.objects.get(user__username="******")
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags["services"]["twitter"], service_twitter)

        # check initial value
        response = self.client.get(url_edit_finding)
        self.assertContains(response, service_twitter)
    def test_edit_finding_looking_for_work(self):
        url_edit_finding = reverse('edit_finding', args=['daveb'])
        url_profile = reverse('user_profile', args=['daveb'])

        new_email = '*****@*****.**'
        looking_for_work = 'freelance'
        data = {'looking_for_work': looking_for_work,
                'email': new_email,
                'first_name': 'Hello',
                'last_name': 'World',
                'privacy_search': 'public',
                'privacy_email': 'private',
                'privacy_im': 'private',
                'privacy_irctrack': 'public'}

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['profile']['looking_for_work'], 'full-time')

        response = self.client.post(url_edit_finding, data, follow=True)
        self.assertRedirects(response, url_profile)

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['profile']['looking_for_work'], 'freelance')

        # check initial value
        response = self.client.get(url_edit_finding)
        self.assertContains(response, looking_for_work)
    def test_edit_finding_services(self):
        url_edit_finding = reverse('edit_finding', args=['daveb'])
        url_profile = reverse('user_profile', args=['daveb'])

        service_twitter = 'https://twitter.com/davebbar'
        data = {'service_twitter': service_twitter,
                'email': '*****@*****.**',
                'first_name': 'Hello',
                'last_name': 'World',
                'privacy_search': 'public',
                'privacy_email': 'private',
                'privacy_im': 'private',
                'privacy_irctrack': 'public'}

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['services']['twitter'], '')

        response = self.client.post(url_edit_finding, data, follow=True)
        self.assertRedirects(response, url_profile)

        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())
        self.assertEqual(mtags['services']['twitter'], service_twitter)

        # check initial value
        response = self.client.get(url_edit_finding)
        self.assertContains(response, service_twitter)
Example #7
0
    def test_edit_finding_initial_data(self):
        url_edit_finding = reverse('edit_finding', args=['daveb'])
        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())

        response = self.client.get(url_edit_finding)

        self.assertContains(response, mtags['profile']['looking_for_work'])
        self.assertContains(response, mtags['im']['django'])
        self.assertContains(response, p.user.email)
Example #8
0
    def test_edit_finding_initial_data(self):
        url_edit_finding = reverse("edit_finding", args=["daveb"])
        p = DjangoPerson.objects.get(user__username="******")
        mtags = tagdict(p.machinetags.all())

        response = self.client.get(url_edit_finding)

        self.assertContains(response, mtags["profile"]["looking_for_work"])
        self.assertContains(response, mtags["im"]["django"])
        self.assertContains(response, p.user.email)
    def test_edit_finding_initial_data(self):
        url_edit_finding = reverse('edit_finding', args=['daveb'])
        p = DjangoPerson.objects.get(user__username='******')
        mtags = tagdict(p.machinetags.all())

        response = self.client.get(url_edit_finding)

        self.assertContains(response, mtags['profile']['looking_for_work'])
        self.assertContains(response, mtags['im']['django'])
        self.assertContains(response, p.user.email)