Exemplo n.º 1
0
def create_default_aboutme_content(app, created_models, verbosity, db, **kwargs):
    if AboutMe in created_models:
        if verbosity >= 2:
            print "Creating default about me data"
        aboutme = AboutMe(
            given_name="Andriy",
            family_name="Tomchuk",
            middle_name="Yuriyovich",
            cell_phone="+380638671171",
            home_phone="+380322706966",
            bio=BIO,
        )
        aboutme.save()
Exemplo n.º 2
0
def edit(request):
    aboutme = AboutMe.get_aboutme()
    if request.method=="POST":
        form = AboutMeForm(request.POST, instance=aboutme)
        if not form.errors:
            form.save()
    else:
        form = AboutMeForm(instance=aboutme)
    return render_to_response("aboutme/edit.html", {'form': form}, context_instance=RequestContext(request))
Exemplo n.º 3
0
    def testEditPage(self):
        """
        Testing edit page
        """

        user = User.objects.create_user('bob', '*****@*****.**', 'jah')
        user.is_superuser = True
        user.save()
        self.client.login(username='******', password='******')
        response = self.client.post('/aboutme/edit',{'given_name': 'First', 
                                                     'family_name': 'Tomchuk', 
                                                     'middle_name': 'Some Name', 
                                                     'cell_phone': '+38887777778', 
                                                     'bio': 'test'})
        aboutme = AboutMe.get_aboutme()
       
        self.assertEqual(response.status_code, 200)
        self.failUnless('Edit aboutme data.' in response.content)
        self.assertEquals(aboutme.given_name, 'First')
Exemplo n.º 4
0
def index(request):
    aboutme = AboutMe.get_aboutme()
    return render_to_response('aboutme/index.html', {'aboutme': aboutme}, context_instance=RequestContext(request))