Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r11765: LJSUP-11926 (ensure that fotobilder API ...

Committer: ailyin
LJSUP-11926 (ensure that fotobilder API works with the new photo hosting)
U   trunk/bin/test/esn/run.pl
Modified: trunk/bin/test/esn/run.pl
===================================================================
--- trunk/bin/test/esn/run.pl	2012-04-23 14:55:58 UTC (rev 11764)
+++ trunk/bin/test/esn/run.pl	2012-04-23 15:02:21 UTC (rev 11765)
@@ -13,6 +13,7 @@
 use Carp qw(cluck confess);
 use LJ::Subscription::GroupSet;
 use LJ::NotificationMethod;
+use LJ::Test;
 
 no warnings 'once';
 die unless $LJ::IS_DEV_SERVER;
@@ -22,38 +23,7 @@
 sub create_user {
     my ($prefix) = @_;
 
-    my @chars = split //, 'abcdefghijklmnopqrstuvwxyz';
-    my $chars_count = scalar(@chars);
-
-    my ($username, $u);
-
-    do {
-        $username = $prefix;
-
-        foreach (1..(15-length($prefix))) {
-            $username .= $chars[rand($chars_count)] ;
-        }
-        $u = LJ::load_user($username);
-    } while ($u);
-
-    $u = LJ::User->create_personal(
-        'user'       => $username,
-        'bdate'      => '1980-01-01',
-        'email'      => 'jemmix+esntest@gmail.com', # this email doesn't actually work :p
-        'password'   => 'test',
-        'get_ljnews' => 0,
-        'underage'   => 0,
-        'ofage'      => 1,
-    );
-
-    LJ::update_user($u, { 'status' => 'A' });
-    $u->add_to_class('paid');
-    $u->remove_from_class('plus');
-    $u->set_password('test');
-
-    warn "created user " . $u->user if $verbose;
-
-    return $u;
+    return LJ::Test->create_user( 'user_prefix' => $prefix );
 }
 
 sub create_entry {

Tags: ailyin, andy, ljcom, pl
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments